16#ifndef BOWCOMPLEXTOKEN_H
17#define BOWCOMPLEXTOKEN_H
22#include <boost/tuple/tuple.hpp>
25#include <boost/shared_ptr.hpp>
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;
150 const std::deque< Part >&
getParts(
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);
243 virtual std::set< uint64_t >
getVertices()
const override;
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.
std::string getstdstringParts() const
BoWComplexToken(const Lima::LimaString &lemma, const LinguisticCode category, const uint64_t position, const uint64_t length)
copy constructor
virtual void clear() override
virtual Lima::LimaString getLemma(void) const override
virtual Lima::LimaString getInflectedForm(void) const override
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 Common::Misc::PositionLengthList getPositionLengthList() const override
get the list of (position,length) couples of the elements of the token (if several)
uint64_t getHead() const
add a part in the list of parts of the complex token.
uint64_t size(void) const override
size is the number of parts in the token
void addToPosition(const uint64_t offset) override
add the offset to the positions of the token and of each of its parts (recusrively)
boost::shared_ptr< BoWToken > addPart(boost::shared_ptr< BoWToken > tok, const bool isHead=false)
add a part in the list of parts of the complex token.
void setHead(const uint64_t)
std::deque< Part >::iterator getPartsIterator(void)
std::string getUTF8StringParts(const Common::PropertyCode::PropertyManager *macroManager=0) const
friend class BoWComplexTokenPrivate
virtual BoWType getType() const override=0
std::deque< Part > & getParts(void)
virtual std::set< uint64_t > getVertices() const override
returns the vertices of all its parts
This class is used to type the relation between a part and its enclosing complex token.
BoWToken(const Lima::LimaString &lemma, const LinguisticCode category, const uint64_t position, const uint64_t length)
Provide tools to manage a specific property.
BoWType
enum to characterize the type of the AbstractBoWElement
std::vector< std::pair< Position, Length > > PositionLengthList