![]() |
LIMA
Libre Multilingual Analyzer — C++ API
|
This is a complex token for an index. More...
#include <linguisticProcessing/common/BagOfWords/bowComplexToken.h>
Classes | |
| class | Part |
| This class represents a part of a ComplexToken : it is composed of a pointer on the actual part (a BoWToken), and a boolean that says if the BoWToken is also in the global list (the BoWText) or not. More... | |
Public Member Functions | |
| BoWComplexToken () | |
| 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, not listed elsewhere in a BoWText) | |
| virtual | ~BoWComplexToken () |
| virtual void | clear () override |
| virtual Lima::LimaString | getLemma (void) const override |
| virtual Lima::LimaString | getInflectedForm (void) const override |
| BoWComplexToken & | operator= (const BoWComplexToken &) |
| bool | operator== (const BoWComplexToken &) |
| uint64_t | size (void) const override |
| size is the number of parts in the token | |
| std::deque< Part > & | getParts (void) |
| const std::deque< Part > & | getParts (void) const |
| std::deque< Part >::iterator | getPartsIterator (void) |
| const std::deque< Part >::const_iterator | getPartsIterator (void) const |
| 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. | |
| boost::shared_ptr< BoWToken > | addPart (boost::shared_ptr< BoWRelation > rel, boost::shared_ptr< BoWToken > tok, const bool isHead=false) |
| add a part in the list of parts of the complex token. | |
| uint64_t | getHead () const |
| add a part in the list of parts of the complex token. | |
| void | setHead (const uint64_t) |
| virtual BoWType | getType () const override=0 |
| std::string | getUTF8StringParts (const Common::PropertyCode::PropertyManager *macroManager=0) const |
| std::string | getstdstringParts () const |
| virtual Common::Misc::PositionLengthList | getPositionLengthList () const override |
| get the list of (position,length) couples of the elements of the token (if several) | |
| void | addToPosition (const uint64_t offset) override |
| add the offset to the positions of the token and of each of its parts (recusrively) | |
| virtual std::set< uint64_t > | getVertices () const override |
| returns the vertices of all its parts | |
Public Member Functions inherited from Lima::Common::BagOfWords::BoWToken | |
| BoWToken (const Lima::LimaString &lemma, const LinguisticCode category, const uint64_t position, const uint64_t length) | |
| BoWToken (const Lima::LimaString &str, const uint64_t position=0, const uint64_t length=0) | |
| BoWToken (const BoWToken &tok) | |
| BoWToken () | |
| virtual | ~BoWToken () |
| virtual BoWToken * | clone () const override |
| LinguisticCode | getCategory (void) const |
| uint64_t | getPosition (void) const override |
| uint64_t | getLength (void) const override |
| void | setLemma (const Lima::LimaString &lemma) |
| void | setInflectedForm (const Lima::LimaString &inflectedForm) |
| void | setCategory (LinguisticCode c) |
| void | setPosition (const uint64_t pos) override |
| void | setLength (const uint64_t len) override |
| virtual Lima::LimaString | getString (void) const override |
| uint64_t | getVertex () const |
| void | setVertex (uint64_t vertex) |
| virtual std::string | getOutputUTF8String (const Common::PropertyCode::PropertyManager *macroManager=0) const override |
| get a string of the BoWToken for output function | |
| virtual std::string | getIdUTF8String () const override |
| function used to identify a bowtoken in a text (used in BowDumper) | |
| bool | operator== (const BoWToken &) const |
| redefine equality | |
| bool | operator!= (const BoWToken &) const |
| redefine inequality as negation of equality. | |
Public Member Functions inherited from Lima::Common::BagOfWords::AbstractBoWElement | |
| AbstractBoWElement () | |
| virtual | ~AbstractBoWElement () |
Protected Member Functions | |
| BoWComplexToken (BoWComplexTokenPrivate &d) | |
Protected Member Functions inherited from Lima::Common::BagOfWords::BoWToken | |
| BoWToken (BoWTokenPrivate &d) | |
| BoWToken & | operator= (const BoWToken &tok) |
| bool | operator== (const BoWToken &tok) |
Friends | |
| class | BoWComplexTokenPrivate |
Additional Inherited Members | |
Static Public Member Functions inherited from Lima::Common::BagOfWords::BoWToken | |
| static void | setInternalSeparator (const LimaChar c) |
| static void | setCompoundSeparator (const LimaChar c) |
| static LimaChar | getInternalSeparator () |
| static LimaChar | getCompoundSeparator () |
| static void | setUseOnlyLemma (const bool b) |
| static bool | getUseOnlyLemma () |
Protected Attributes inherited from Lima::Common::BagOfWords::BoWToken | |
| BoWTokenPrivate * | m_d |
This is a complex token for an index.
It is made of a collection of BoWTokens's, one of which is the head of the token.
Definition at line 42 of file bowComplexToken.h.
| Lima::Common::BagOfWords::BoWComplexToken::BoWComplexToken | ( | ) |
Definition at line 95 of file bowComplexToken.cpp.
| Lima::Common::BagOfWords::BoWComplexToken::BoWComplexToken | ( | const Lima::LimaString & | lemma, |
| const LinguisticCode | category, | ||
| const uint64_t | position, | ||
| const uint64_t | length | ||
| ) |
| Lima::Common::BagOfWords::BoWComplexToken::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, not listed elsewhere in a BoWText)
| lemma | the lemma of the complex token |
| category | the category of the complex token |
| position | the position of the complex token |
| length | the length of the complex token |
| parts | a deque containing the simple tokens forming the parts of the complex token |
| int | head the index of the head token in the preceding list |
|
virtual |
Definition at line 140 of file bowComplexToken.cpp.
|
protected |
Definition at line 136 of file bowComplexToken.cpp.
| boost::shared_ptr< BoWToken > Lima::Common::BagOfWords::BoWComplexToken::addPart | ( | boost::shared_ptr< BoWRelation > | rel, |
| boost::shared_ptr< BoWToken > | tok, | ||
| const bool | isHead = false |
||
| ) |
add a part in the list of parts of the complex token.
Have to specify if the token forming the part exists as a proper token or only as a part: in the first case, the pointer is added in the part list, in the second case, a pointer on a copy of the token is added in the list.
| rel | a pointer on the BoWRelation linking the part to add to the head or the other parts |
| tok | a pointer on the BoWToken forming the part to add |
| isInList | a boolean indicating, if true, that the BoWToken pointed has an existence outside of the part list |
| isHead | a boolean indicating that the BoWToken a |
Definition at line 257 of file bowComplexToken.cpp.
| boost::shared_ptr< BoWToken > Lima::Common::BagOfWords::BoWComplexToken::addPart | ( | boost::shared_ptr< BoWToken > | tok, |
| const bool | isHead = false |
||
| ) |
add a part in the list of parts of the complex token.
Have to specify if the token forming the part exists as a proper token or only as a part: in the first case, the pointer is added in the part list, in the second case, a pointer on a copy of the token is added in the list.
| tok | a pointer on the BoWToken forming the part to add |
| isInList | a boolean indicating, if true, that the BoWToken pointed has an existence outside of the part list |
| isHead | a boolean indicating that the BoWToken a |
Definition at line 250 of file bowComplexToken.cpp.
|
overridevirtual |
add the offset to the positions of the token and of each of its parts (recusrively)
| offset | the offset to add to all positions |
Reimplemented from Lima::Common::BagOfWords::BoWToken.
Definition at line 367 of file bowComplexToken.cpp.
|
overridevirtual |
Reimplemented from Lima::Common::BagOfWords::BoWToken.
Definition at line 280 of file bowComplexToken.cpp.
| uint64_t Lima::Common::BagOfWords::BoWComplexToken::getHead | ( | ) | const |
add a part in the list of parts of the complex token.
A pointer on a copy of tok is added in the list.
| tok | a pointer on the BoWToken forming the part to be copied and added |
| isHead | a boolean indicating that the BoWToken is the head of the complex token it is part of add a part in the list of parts of the complex token. A pointer on a copy of tok is added in the list. |
| rel | a pointer on the BoWRelation linking the part to copy and add to the head or the other parts |
| tok | a pointer on the BoWToken forming the part to be copied and added |
| isHead | a boolean indicating that the BoWToken is the head of the complex token it is part of |
Definition at line 210 of file bowComplexToken.cpp.
|
overridevirtual |
Reimplemented from Lima::Common::BagOfWords::BoWToken.
Definition at line 317 of file bowComplexToken.cpp.
|
overridevirtual |
Reimplemented from Lima::Common::BagOfWords::BoWToken.
Definition at line 299 of file bowComplexToken.cpp.
| std::deque< BoWComplexToken::Part > & Lima::Common::BagOfWords::BoWComplexToken::getParts | ( | void | ) |
Definition at line 187 of file bowComplexToken.cpp.
| const std::deque< BoWComplexToken::Part > & Lima::Common::BagOfWords::BoWComplexToken::getParts | ( | void | ) | const |
Definition at line 193 of file bowComplexToken.cpp.
| std::deque< BoWComplexToken::Part >::iterator Lima::Common::BagOfWords::BoWComplexToken::getPartsIterator | ( | void | ) |
Definition at line 199 of file bowComplexToken.cpp.
| const std::deque< BoWComplexToken::Part >::const_iterator Lima::Common::BagOfWords::BoWComplexToken::getPartsIterator | ( | void | ) | const |
Definition at line 205 of file bowComplexToken.cpp.
|
overridevirtual |
get the list of (position,length) couples of the elements of the token (if several)
Reimplemented from Lima::Common::BagOfWords::BoWToken.
Definition at line 352 of file bowComplexToken.cpp.
| std::string Lima::Common::BagOfWords::BoWComplexToken::getstdstringParts | ( | ) | const |
Definition at line 402 of file bowComplexToken.cpp.
|
overridepure virtual |
Reimplemented from Lima::Common::BagOfWords::BoWToken.
Implemented in Lima::Common::BagOfWords::BoWNamedEntity, and Lima::Common::BagOfWords::BoWTerm.
| std::string Lima::Common::BagOfWords::BoWComplexToken::getUTF8StringParts | ( | const Common::PropertyCode::PropertyManager * | macroManager = 0 | ) | const |
Definition at line 379 of file bowComplexToken.cpp.
|
overridevirtual |
returns the vertices of all its parts
Reimplemented from Lima::Common::BagOfWords::BoWToken.
Reimplemented in Lima::Common::BagOfWords::BoWNamedEntity.
Definition at line 420 of file bowComplexToken.cpp.
| BoWComplexToken & Lima::Common::BagOfWords::BoWComplexToken::operator= | ( | const BoWComplexToken & | t | ) |
Definition at line 146 of file bowComplexToken.cpp.
| bool Lima::Common::BagOfWords::BoWComplexToken::operator== | ( | const BoWComplexToken & | t | ) |
Definition at line 155 of file bowComplexToken.cpp.
| void Lima::Common::BagOfWords::BoWComplexToken::setHead | ( | const uint64_t | i | ) |
Definition at line 215 of file bowComplexToken.cpp.
|
overridevirtual |
size is the number of parts in the token
Reimplemented from Lima::Common::BagOfWords::BoWToken.
Definition at line 337 of file bowComplexToken.cpp.
|
friend |
Definition at line 44 of file bowComplexToken.h.