Tanl Linguistic Pipeline |
Represents the attributes of a token. More...
#include <Token.h>
Classes | |
struct | const_iterator |
Public Types | |
typedef std::string | Attribute |
typedef std::string | Attribute |
Public Member Functions | |
Attributes (AttributeIndex *attributeIndex) | |
Attributes (AttributeIndex *attributeIndex, std::vector< Attribute > &values) | |
Attribute & | operator[] (int i) |
bool | operator== (const Attributes &other) |
bool | operator!= (const Attributes &other) |
const_iterator | begin () const |
const_iterator | end () const |
std::string const * | get (std::string const &name) const |
Get the value of attribute with name name . | |
std::string const * | get (char const *name) const |
Get the value of attribute with name name . | |
AttributeId | index (char const *key) const |
Get the AttributeId for key key or WordIndex::None if not present. | |
void | insert (char const *key, char const *value) |
Insert a new attribute with key key and value value . | |
void | insert (char const *key, std::string const &value) |
Insert a new attribute with key key and value value . | |
void | insert (char const *key, int value) |
Insert a new attribute with key key and value value . | |
Attributes (AttributeIndex *attributeIndex) | |
Attributes (AttributeIndex *attributeIndex, std::vector< Attribute > &values) | |
Attribute & | operator[] (int i) |
bool | operator== (const Attributes &other) |
bool | operator!= (const Attributes &other) |
const_iterator | begin () const |
const_iterator | end () const |
std::string const * | get (std::string const &name) const |
Get the value of attribute with name name . | |
std::string const * | get (char const *name) const |
Get the value of attribute with name name . | |
AttributeId | index (char const *key) const |
Get the AttributeId for key key or WordIndex::None if not present. | |
void | insert (char const *key, char const *value) |
Insert a new attribute with key key and value value . | |
void | insert (char const *key, std::string const &value) |
Insert a new attribute with key key and value value . | |
void | insert (char const *key, int value) |
Insert a new attribute with key key and value value . | |
Public Attributes | |
AttributeIndex * | attributeIndex |
std::vector< Attribute > | values |
Static Public Attributes | |
static AttributeIndex * | emptyAttrIndex = new AttributeIndex() |
Represents the attributes of a token.
It behaves similarly to hash_map<char const*, string>, but it uses an internal map attributeIndex
to provide access to attributes by name, which can be shared by tokens from the same corpus.