16#ifndef BOWCOMPLEXTOKEN_H
17#define BOWCOMPLEXTOKEN_H
22#include <boost/tuple/tuple.hpp>
25#include <boost/shared_ptr.hpp>
35class BoWComplexTokenPrivate;
53 class Part :
public boost::tuple< boost::shared_ptr< BoWRelation >,
54 boost::shared_ptr< BoWToken > >
64 Part(boost::shared_ptr< BoWToken > tok):
71 Part(boost::shared_ptr< BoWRelation > rel,
72 boost::shared_ptr< BoWToken > tok) :
80 boost::shared_ptr< BoWToken >
getBoWToken()
const {
return get<1>(); }
109 const uint64_t position,
110 const uint64_t length);
128 const uint64_t position,
129 const uint64_t length,
130 std::deque< boost::shared_ptr< Lima::Common::BagOfWords::BoWToken > >& parts,
131 const uint64_t head);
138 virtual void clear()
override;
147 uint64_t size(
void)
const override;
149 std::deque< Part >& getParts(
void);
150 const std::deque< Part >& getParts(
void)
const;
152 std::deque< Part >::iterator getPartsIterator(
void);
153 const std::deque< Part >::const_iterator getPartsIterator(
void)
const;
167 boost::shared_ptr< BoWToken > addPart(boost::shared_ptr< BoWToken > tok,
168 const bool isHead=
false);
184 boost::shared_ptr< BoWToken > addPart(boost::shared_ptr< BoWRelation > rel,
185 boost::shared_ptr< BoWToken > tok,
186 const bool isHead=
false);
217 uint64_t getHead()
const;
218 void setHead(
const uint64_t);
225 std::string getstdstringParts()
const;
235 void addToPosition(
const uint64_t offset)
override;
243 virtual std::set< uint64_t > getVertices()
const override;
This class represents a part of a ComplexToken : it is composed of a pointer on the actual part (a Bo...
boost::shared_ptr< BoWToken > getBoWToken() const
Part(boost::shared_ptr< BoWToken > tok)
LimaString getLemma() const
LinguisticCode getCategory() const
boost::shared_ptr< BoWRelation > getBoWRelation() const
Part(boost::shared_ptr< BoWRelation > rel, boost::shared_ptr< BoWToken > tok)
This is a complex token for an index.
BoWComplexToken(const Lima::LimaString &lemma, const LinguisticCode category, const uint64_t position, const uint64_t length)
BoWComplexToken(const Lima::LimaString &lemma, const LinguisticCode category, const uint64_t position, const uint64_t length, std::deque< boost::shared_ptr< Lima::Common::BagOfWords::BoWToken > > &parts, const uint64_t head)
a constructor to build a simple, independent complex token (parts are simple tokens,...
virtual BoWType getType() const override=0
This class is used to type the relation between a part and its enclosing complex token.
This class contains the representation of an element of the bag of words.
Provide tools to manage a specific property.
BoWType
enum to characterize the type of the AbstractBoWElement
std::vector< std::pair< Position, Length > > PositionLengthList