DeSR Dependency Parser

Tanl::Token Struct Reference

Represents a sentence token (a word in a sentence). More...

#include <Token.h>

Collaboration diagram for Tanl::Token:

Collaboration graph

List of all members.

Classes

struct  Morpho
 Compact morphology representation. More...

Public Member Functions

 Token (std::string form, Attributes &attributes)
 Token (std::string form, Attributes &attributes, TokenLinks &links)
 Token (Attributes &attributes)
 Token (std::string &form, AttributeIndex *attributeIndex)
 Token (char const *form, AttributeIndex *attributeIndex)
 Token (AttributeIndex *attributeIndex)
std::string const * get (char const *key) const
void set (char const *key, char const *value)
 Add the attribute value associated to key key.
void set (char const *key, std::string const &value)
 Add the attribute value associated to key key.
int attrIndex (char const *name) const
 Get the index of a given attribute name.
bool isNoun (Language const *lang)
bool isPreposition (Language const *lang)
bool isTime (Language const *lang)
bool isLocation (Language const *lang)
bool isVerb (Language const *lang)
std::string const * getLemma () const
std::string const * getPos () const
void print (std::ostream &os, int indent=0) const
 output token in XML format

Public Attributes

std::string form
 word form
Morpho morpho
 morphology
Attributes attributes
 additional attributes
TokenLinks links
 additional links


Detailed Description

Represents a sentence token (a word in a sentence).

Definition at line 208 of file Token.h.


Member Function Documentation

int Tanl::Token::attrIndex ( char const *  name  )  const [inline]

Get the index of a given attribute name.

Definition at line 306 of file Token.h.

References Tanl::Attributes::attributeIndex, attributes, and Tanl::AttributeIndex::names.

std::string const* Tanl::Token::get ( char const *  key  )  const [inline]

Returns:
the attribute associated to key key, or 0 if not present.

Definition at line 291 of file Token.h.

References attributes, and Tanl::Attributes::get().

void Tanl::Token::set ( char const *  key,
std::string const &  value 
) [inline]

Add the attribute value associated to key key.

Definition at line 301 of file Token.h.

References attributes, and Tanl::Attributes::insert().

void Tanl::Token::set ( char const *  key,
char const *  value 
) [inline]

Add the attribute value associated to key key.

Definition at line 296 of file Token.h.

References attributes, and Tanl::Attributes::insert().

Referenced by Tanl::TreeToken::set().


The documentation for this struct was generated from the following files:
 
Copyright © 2005-2007 G. Attardi. Generated on 13 Aug 2009 by doxygen 1.5.7.1.