#include <fg_sxtoken.h>
Public Types | |
|
typedef map< string, SxTokenCat, less< string > > | SxCatMap |
| Map of strings to enum SxToken::SxTokenCat. | |
| typedef map< SxTokenCat, string > | SxInvCatMap |
| Map of enum SxToken::SxTokenCat to strings. | |
| enum | SxTokenCat { SxC_NONE = 0, SxC_Adj, SxC_Adj11, SxC_Adj1P, SxC_Adj1S, SxC_AdjFP, SxC_AdjFS, SxC_AdjIng, SxC_AdjMP, SxC_AdjMS, SxC_AdjNum, SxC_Adv, SxC_AdvGP, SxC_Advp, SxC_CCoord, SxC_CSub, SxC_Det, SxC_Det11, SxC_Det1P, SxC_Det1S, SxC_DetFP, SxC_DetFS, SxC_DetMP, SxC_DetMS, SxC_DetNum, SxC_Elim, SxC_Nom1P, SxC_Nom1Pp, SxC_Nom1S, SxC_Nom1Sp, SxC_NomFP, SxC_NomFS, SxC_NomInc, SxC_NomIng, SxC_NomMP, SxC_NomMS, SxC_NomPr, SxC_NomPrXXInc, SxC_NomPrXXPrenom, SxC_NomXXAdr, SxC_NomXXDate, SxC_NomXXMes, SxC_NomXXMon, SxC_NomXXNum, SxC_NomXXTitre, SxC_NomXXUrl, SxC_Num, SxC_POS, SxC_Ppa, SxC_PpaFP, SxC_PpaFS, SxC_PpaMP, SxC_PpaMS, SxC_Ppap, SxC_Ppr, SxC_PprIng, SxC_PprIngp, SxC_Pprp, SxC_Prep, SxC_Pro, SxC_ProRel, SxC_RP, SxC_SENT, SxC_Typo, SxC_VCONJ, SxC_VCONJP, SxC_VCONJPp, SxC_VCONJS, SxC_VCONJSp, SxC_VCONJp, SxC_VINF, SxC_VINFp } |
| Grammatical category. More... | |
Public Member Functions | |
| SxToken () | |
| Default constructor. | |
| virtual | ~SxToken () |
| Default destructor. | |
| SxTokenCat | getCat () const |
| Gets the grammatical category for this token. | |
| bool | setCat (const string &catStr) |
| Sets the grammatical category for this token. | |
| void | setCat (SxTokenCat cat) |
| Sets the grammatical category for this token. | |
| const string & | getLemma () const |
| Get the token's lemma. | |
| void | setLemma (const string &lemma) |
| Set the token's lemma. | |
| const string & | getTokenText () const |
| Gets the token text from the original analysis. | |
| void | setTokenText (const string &tokenText) |
| Sets the token text from the original analysis. | |
| unsigned int | getId () const |
| Gets the unique sequential identifier for this token. | |
| void | setId (unsigned int id) |
| Sets the unique sequential identifier for this token. | |
| const list< SxRel > & | getRegiRelList () const |
| Returns the relation list where this token acts as a regi. | |
| void | addRegiRel (const SxRel regiRel) |
| Adds a relation to the relation list where this token acts as a regi. | |
| const list< SxRel > & | getRecteurRelList () const |
| Returns the relation list where this token acts as a recteur. | |
| void | addRecteurRel (const SxRel recteurRel) |
| Adds a relation to the relation list where this token acts as a recteur. | |
Static Public Member Functions | |
| SxTokenCat | stringToCat (const string &catStr) |
| Maps a string describing a grammatical cat. | |
| const string & | catToString (SxTokenCat cat) |
| Maps an enum describing a grammatical cat. | |
Friends | |
| ostream & | operator<< (ostream &os, const SxToken &token) |
| Output function. | |
Each of these tokens is associated with a grammatical category, a token sequence number beginning with 1, a lemma and a list of relations where this token is either a recteur or a regi
This class also provides a mapping mechanism between the textual representation a grammatical category (e.g. Adj, Adj?P, etc.) and the corresponding enum value.
|
|
Grammatical category. Note that the '?'s in the original strings are replaced with '1's to respect C++'s syntax. |
|
|
Adds a relation to the relation list where this token acts as a recteur.
|
|
|
Adds a relation to the relation list where this token acts as a regi.
|
|
|
Maps an enum describing a grammatical cat.
to the corresponding string. If the category is not recognized, the empty string
|
|
|
Gets the grammatical category for this token.
|
|
|
Gets the unique sequential identifier for this token. The sequence starts from the number 1.
|
|
|
Get the token's lemma. This may be multiple words (e.g. for verbs).
|
|
|
Returns the relation list where this token acts as a recteur. This list can be empty.
|
|
|
Returns the relation list where this token acts as a regi. This list can be empty.
|
|
|
Gets the token text from the original analysis.
|
|
|
Sets the grammatical category for this token.
|
|
|
Sets the grammatical category for this token. If the category string is not recognized, the operation fails.
|
|
|
Sets the unique sequential identifier for this token. The sequence starts from the number 1.
|
|
|
Set the token's lemma.
|
|
|
Sets the token text from the original analysis.
|
|
|
Maps a string describing a grammatical cat. to the corresponding enum. If the string is not recognized, SxToken::SxR_NONE is returned.
|
|
||||||||||||
|
Output function. Use this operator to write a token onto a stream. The output format is exactly the same as the input format. However, there may be some differences for a few tokens between the input read and the output from this function, since the output format of Syntex is buggy at times and this output function corrects any problem encountered during the parsing phase.
|
1.3.6