#include <fg_sxsent.h>
Public Member Functions | |
| SxSent () | |
| Default constructor. | |
| virtual | ~SxSent () |
| Default destructor. | |
| const string & | getId () const |
| Gets the id of the sentence. | |
| void | setId (const string &id) |
| Sets the id for the sentence. | |
| const int | getAnalyse () const |
| Get the analysis number for the sentence. | |
| void | setAnalyse (const int analyse) |
| Sets the analysis number for the sentence. | |
| const string & | getTxt () const |
| Gets the source text for this sentence. | |
| void | setTxt (const string &txt) |
| Sets the source text for this sentence. | |
| bool | isValid () const |
| Determines if this sentence is valid, that is, it has been parsed without errors. | |
| void | setValid (bool bValid) |
| Sets the validity of this sentence. | |
| SxToken & | getToken (unsigned int index) |
| Returns the token (word) at position index. | |
| const vector< SxToken > & | getAllTokens () const |
| Returns a vector containing all the tokens (words) in this sentence. | |
| unsigned int | getNbTokens () const |
| Counts the number of tokens in this sentence. | |
Static Public Member Functions | |
| void | splitString (const string &s, const char delim, vector< string > &v) |
| Splits a string using delim as a delimiter character. | |
Friends | |
| istream & | operator>> (istream &is, SxSent &sent) |
| Parsing function. | |
| ostream & | operator<< (ostream &os, const SxSent &sent) |
| Output function. | |
Apart from parsing, this class creates the necessay Tokens and Relations to entirely describe an analysis made by Syntex.
|
|
Returns a vector containing all the tokens (words) in this sentence.
|
|
|
Get the analysis number for the sentence.
|
|
|
Gets the id of the sentence.
|
|
|
Counts the number of tokens in this sentence.
|
|
|
Returns the token (word) at position index. Positions start at 1 (not 0).
|
|
|
Gets the source text for this sentence.
|
|
|
Determines if this sentence is valid, that is, it has been parsed without errors. Doesn't do any advanced consistency tests.
|
|
|
Sets the analysis number for the sentence.
|
|
|
Sets the id for the sentence.
|
|
|
Sets the source text for this sentence.
|
|
|
Sets the validity of this sentence. A sentence is invalid until the end of the parsing operation.
|
|
||||||||||||||||
|
Splits a string using delim as a delimiter character.
|
|
||||||||||||
|
Output function. Use this operator to write a sentence onto a stream. The output format is exactly the same as the input format. However, there may be some differences for a few sentences 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.
|
|
||||||||||||
|
Parsing function. Use this operator to read a stream (stdin, file, etc.) into a sent object previously created. If an error is encountered during the parsing, a error message will be printed on stderr, but the failbit of the stream will not be set. Even after an error, a subsequent read operation will try to recover from the error and read the next sentence in the stream. If an error occurs during the parsing, the resulting sent will be invalid.
|
1.3.6