![]() |
LIMA
Libre Multilingual Analyzer — C++ API
|
This class contains the representation of an element of the bag of words. More...
#include <linguisticProcessing/common/BagOfWords/bowToken.h>
Public Member Functions | |
| 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 void | clear () override |
| virtual BoWToken * | clone () const override |
| virtual Lima::LimaString | getLemma (void) const |
| virtual Lima::LimaString | getInflectedForm (void) const |
| LinguisticCode | getCategory (void) const |
| uint64_t | getPosition (void) const override |
| uint64_t | getLength (void) const override |
| virtual uint64_t | size (void) const override |
| size of the BoWToken is the number of parts in the token | |
| 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 |
| virtual BoWType | getType () const override |
| uint64_t | getVertex () const |
| void | setVertex (uint64_t vertex) |
| virtual std::set< uint64_t > | getVertices () const override |
| returns a singleton made of the value of the getVertex function. | |
| 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. | |
| virtual Common::Misc::PositionLengthList | getPositionLengthList () const |
| get the list of (position,length) couples of the elements of the token (if several) | |
| virtual void | addToPosition (const uint64_t offset) |
| add the offset to the position of the token | |
Public Member Functions inherited from Lima::Common::BagOfWords::AbstractBoWElement | |
| AbstractBoWElement () | |
| virtual | ~AbstractBoWElement () |
Static Public Member Functions | |
| 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 Member Functions | |
| BoWToken (BoWTokenPrivate &d) | |
| BoWToken & | operator= (const BoWToken &tok) |
| bool | operator== (const BoWToken &tok) |
Protected Attributes | |
| BoWTokenPrivate * | m_d |
Friends | |
| class | BoWTokenPrivate |
| LIMA_BOW_EXPORT std::ostream & | operator<< (std::ostream &, const BoWToken &) |
| LIMA_BOW_EXPORT QDebug & | operator<< (QDebug &, const BoWToken &) |
| LIMA_BOW_EXPORT std::ostream & | operator<< (std::ostream &os, const Common::Misc::PositionLengthList &p) |
| LIMA_BOW_EXPORT QDebug & | operator<< (QDebug &os, const Common::Misc::PositionLengthList &p) |
| LIMA_BOW_EXPORT std::ostream & | operator<< (std::ostream &os, const std::map< BoWToken *, uint64_t > &refMap) |
| only for debug | |
| LIMA_BOW_EXPORT QDebug & | operator<< (QDebug &os, const std::map< BoWToken *, uint64_t > &refMap) |
This class contains the representation of an element of the bag of words.
This element is characterized by a normalized form, a grammatical category, its position and length. It can be a simple word, a multiterm or a named entity.
Definition at line 45 of file bowToken.h.
| Lima::Common::BagOfWords::BoWToken::BoWToken | ( | const Lima::LimaString & | lemma, |
| const LinguisticCode | category, | ||
| const uint64_t | position, | ||
| const uint64_t | length | ||
| ) |
| Lima::Common::BagOfWords::BoWToken::BoWToken | ( | const Lima::LimaString & | str, |
| const uint64_t | position = 0, |
||
| const uint64_t | length = 0 |
||
| ) |
| Lima::Common::BagOfWords::BoWToken::BoWToken | ( | const BoWToken & | tok | ) |
Definition at line 204 of file bowToken.cpp.
| Lima::Common::BagOfWords::BoWToken::BoWToken | ( | ) |
Definition at line 182 of file bowToken.cpp.
|
virtual |
Definition at line 274 of file bowToken.cpp.
|
protected |
Definition at line 173 of file bowToken.cpp.
|
virtual |
add the offset to the position of the token
Reimplemented in Lima::Common::BagOfWords::BoWComplexToken.
Definition at line 326 of file bowToken.cpp.
|
inlineoverridevirtual |
Reimplemented from Lima::Common::BagOfWords::AbstractBoWElement.
Reimplemented in Lima::Common::BagOfWords::BoWComplexToken.
Definition at line 62 of file bowToken.h.
|
overridevirtual |
Implements Lima::Common::BagOfWords::AbstractBoWElement.
Reimplemented in Lima::Common::BagOfWords::BoWNamedEntity, and Lima::Common::BagOfWords::BoWTerm.
Definition at line 255 of file bowToken.cpp.
| LinguisticCode Lima::Common::BagOfWords::BoWToken::getCategory | ( | void | ) | const |
Definition at line 285 of file bowToken.cpp.
|
static |
Definition at line 321 of file bowToken.cpp.
|
overridevirtual |
function used to identify a bowtoken in a text (used in BowDumper)
Implements Lima::Common::BagOfWords::AbstractBoWElement.
Reimplemented in Lima::Common::BagOfWords::BoWNamedEntity, and Lima::Common::BagOfWords::BoWTerm.
Definition at line 446 of file bowToken.cpp.
|
virtual |
Reimplemented in Lima::Common::BagOfWords::BoWComplexToken.
Definition at line 284 of file bowToken.cpp.
|
static |
Definition at line 317 of file bowToken.cpp.
|
virtual |
Reimplemented in Lima::Common::BagOfWords::BoWComplexToken.
Definition at line 283 of file bowToken.cpp.
|
overridevirtual |
Implements Lima::Common::BagOfWords::AbstractBoWElement.
Definition at line 287 of file bowToken.cpp.
|
overridevirtual |
get a string of the BoWToken for output function
| macroAccessor | if not null, will output the human readable form of the macrocategory. otherwise output the integer code |
Implements Lima::Common::BagOfWords::AbstractBoWElement.
Reimplemented in Lima::Common::BagOfWords::BoWNamedEntity, and Lima::Common::BagOfWords::BoWTerm.
Definition at line 430 of file bowToken.cpp.
|
overridevirtual |
Implements Lima::Common::BagOfWords::AbstractBoWElement.
Definition at line 286 of file bowToken.cpp.
|
virtual |
get the list of (position,length) couples of the elements of the token (if several)
Reimplemented in Lima::Common::BagOfWords::BoWComplexToken.
Definition at line 382 of file bowToken.cpp.
|
overridevirtual |
Implements Lima::Common::BagOfWords::AbstractBoWElement.
Definition at line 332 of file bowToken.cpp.
|
overridevirtual |
Reimplemented from Lima::Common::BagOfWords::AbstractBoWElement.
Reimplemented in Lima::Common::BagOfWords::BoWNamedEntity, Lima::Common::BagOfWords::BoWTerm, and Lima::Common::BagOfWords::BoWComplexToken.
Definition at line 299 of file bowToken.cpp.
|
static |
Definition at line 305 of file bowToken.cpp.
| uint64_t Lima::Common::BagOfWords::BoWToken::getVertex | ( | ) | const |
Definition at line 301 of file bowToken.cpp.
|
overridevirtual |
returns a singleton made of the value of the getVertex function.
Subclasses like BoWComplexToken reimplement this method to return the set of vertices of all their parts.
Implements Lima::Common::BagOfWords::AbstractBoWElement.
Reimplemented in Lima::Common::BagOfWords::BoWComplexToken, and Lima::Common::BagOfWords::BoWNamedEntity.
Definition at line 454 of file bowToken.cpp.
| bool Lima::Common::BagOfWords::BoWToken::operator!= | ( | const BoWToken & | t | ) | const |
redefine inequality as negation of equality.
Definition at line 407 of file bowToken.cpp.
Definition at line 213 of file bowToken.cpp.
| bool Lima::Common::BagOfWords::BoWToken::operator== | ( | const BoWToken & | t | ) | const |
redefine equality
Definition at line 394 of file bowToken.cpp.
|
protected |
Definition at line 223 of file bowToken.cpp.
| void Lima::Common::BagOfWords::BoWToken::setCategory | ( | LinguisticCode | c | ) |
Definition at line 295 of file bowToken.cpp.
|
static |
Definition at line 312 of file bowToken.cpp.
| void Lima::Common::BagOfWords::BoWToken::setInflectedForm | ( | const Lima::LimaString & | inflectedForm | ) |
Definition at line 293 of file bowToken.cpp.
|
static |
Definition at line 308 of file bowToken.cpp.
| void Lima::Common::BagOfWords::BoWToken::setLemma | ( | const Lima::LimaString & | lemma | ) |
Definition at line 292 of file bowToken.cpp.
|
overridevirtual |
Implements Lima::Common::BagOfWords::AbstractBoWElement.
Definition at line 297 of file bowToken.cpp.
|
overridevirtual |
Implements Lima::Common::BagOfWords::AbstractBoWElement.
Definition at line 296 of file bowToken.cpp.
|
static |
Definition at line 304 of file bowToken.cpp.
| void Lima::Common::BagOfWords::BoWToken::setVertex | ( | uint64_t | vertex | ) |
Definition at line 302 of file bowToken.cpp.
|
overridevirtual |
size of the BoWToken is the number of parts in the token
Implements Lima::Common::BagOfWords::AbstractBoWElement.
Reimplemented in Lima::Common::BagOfWords::BoWComplexToken.
Definition at line 290 of file bowToken.cpp.
|
friend |
Definition at line 47 of file bowToken.h.
|
friend |
Definition at line 423 of file bowToken.cpp.
|
friend |
Definition at line 56 of file positionLengthList.cpp.
|
friend |
|
friend |
Definition at line 416 of file bowToken.cpp.
|
friend |
Definition at line 39 of file positionLengthList.cpp.
|
friend |
only for debug
|
protected |
Definition at line 166 of file bowToken.h.