#include <fg_sxrel.h>
Public Types | |
|
typedef map< string, SxTokenRel, less< string > > | SxRelMap |
| Map of strings to enum SxRel::SxTokenRel. | |
| typedef map< SxTokenRel, string > | SxInvRelMap |
| Map of enum SxRel::SxTokenRel to strings. | |
| enum | SxTokenRel { SxR_NONE = 0, SxR_ADJ, SxR_ADV, SxR_ATT, SxR_CC, SxR_DET, SxR_EPI, SxR_NN, SxR_NNPR, SxR_NOMPREP, SxR_OBJ, SxR_PRDE, SxR_PREP, SxR_REL, SxR_SUJ, SxR_VBATT } |
| Relation type. | |
Public Member Functions | |
| SxRel () | |
| Default constructor. | |
| SxRel (const string &relStr, unsigned int recteur, unsigned int regi) | |
| Constructor. | |
| virtual | ~SxRel () |
| Destructor. | |
| const string & | getRelTypeText () const |
| Returns the relation type for this relation in the form of a string that is recognized by the parser. | |
| bool | setRelType (const string &relTypeText) |
| Sets the relation type for this relation. | |
| SxTokenRel | getRelType () const |
| Returns the relation type for this relation. | |
| void | setRelType (SxTokenRel relType) |
| Sets the relation type for this relation. | |
| unsigned int | getRegi () const |
| Gets the token code for the regi. | |
| void | setRegi (unsigned int regi) |
| Sets the token code for the regi. | |
| unsigned int | getRecteur () const |
| Gets the token code for the recteur. | |
| void | setRecteur (unsigned int recteur) |
| Sets the token code for the recteur. | |
Static Public Member Functions | |
| SxTokenRel | stringToRel (const string &relTxt) |
| Maps a string describing a relation type to the corresponding enum. | |
| const string & | relToString (SxTokenRel rel) |
| Maps an enum describing a relation type to the corresponding string. | |
Friends | |
| ostream & | operator<< (ostream &os, const SxRel &rel) |
| Output function. | |
For each relation, a recteur and a list of regi are defined. To find the token corresponding to this recteur / regi, use the function SxSent::getToken( unsigned int ) to get the token corresponding to the code returned by getRecteur() or getRegi().
The class also contains a mapping mechanism between a relation code (ADJ, ADV,etc. and the corresponding enum.
|
||||||||||||||||
|
Constructor. Creates a relation from the string describing its type and the codes for the recteur and regi. If relStr doesn't correspond to any known relation type, a error message is printed and the program halts.
|
|
|
Gets the token code for the recteur.
|
|
|
Gets the token code for the regi.
|
|
|
Returns the relation type for this relation.
|
|
|
Returns the relation type for this relation in the form of a string that is recognized by the parser.
|
|
|
Maps an enum describing a relation type to the corresponding string.
If the rel is not found, the empty string
|
|
|
Sets the token code for the recteur.
|
|
|
Sets the token code for the regi.
|
|
|
Sets the relation type for this relation.
|
|
|
Sets the relation type for this relation. If the relation type string is not recognized, the operation fails.
|
|
|
Maps a string describing a relation type to the corresponding enum. If the parameter is not recognized, SxReL::SxR_NONE will be returned.
|
|
||||||||||||
|
Output function. Use this operator to write a relation onto a stream. The output format of this function cannot be parsed by the parsing function of the class SxSent.
|
1.3.6