Main Page | Class List | File List | Class Members

SxSent Class Reference

This class implements a reader for the output from Syntex. More...

#include <fg_sxsent.h>

List of all members.

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.

SxTokengetToken (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.


Detailed Description

This class implements a reader for the output from Syntex.

Apart from parsing, this class creates the necessay Tokens and Relations to entirely describe an analysis made by Syntex.

Author:
(c) 2005 RALI - Université de Montréal
Version:
1.0
See also:
SxToken

SxRel


Member Function Documentation

const vector< SxToken > & SxSent::getAllTokens  )  const [inline]
 

Returns a vector containing all the tokens (words) in this sentence.

Returns:
a vector containing all the tokens (words) in this sentence.

const int SxSent::getAnalyse  )  const [inline]
 

Get the analysis number for the sentence.

Returns:
The analysis number for the sentence.

const string & SxSent::getId  )  const [inline]
 

Gets the id of the sentence.

Returns:
The id of the sentence.

unsigned int SxSent::getNbTokens  )  const [inline]
 

Counts the number of tokens in this sentence.

Returns:
The number of tokens in this sentence.

SxToken & SxSent::getToken unsigned int  index  ) 
 

Returns the token (word) at position index.

Positions start at 1 (not 0).

Parameters:
index The token position.
Returns:
The token at position index.

const string & SxSent::getTxt  )  const [inline]
 

Gets the source text for this sentence.

Returns:
the source text for this sentence.

bool SxSent::isValid  )  const [inline]
 

Determines if this sentence is valid, that is, it has been parsed without errors.

Doesn't do any advanced consistency tests.

Returns:
true if the sentence is valid, false otherwise.

void SxSent::setAnalyse const int  analyse  )  [inline]
 

Sets the analysis number for the sentence.

Parameters:
analyse The analysis number for the sentence.

void SxSent::setId const string &  id  )  [inline]
 

Sets the id for the sentence.

Parameters:
id The id for the sentence.

void SxSent::setTxt const string &  txt  )  [inline]
 

Sets the source text for this sentence.

Parameters:
txt The source text for this sentence.

void SxSent::setValid bool  bValid  )  [inline]
 

Sets the validity of this sentence.

A sentence is invalid until the end of the parsing operation.

Parameters:
bValid The validity status.

void SxSent::splitString const string &  s,
const char  delim,
vector< string > &  v
[static]
 

Splits a string using delim as a delimiter character.

Parameters:
s The string to split.
delim The delimiter character.
v The vector in which the different fragments will be stored.


Friends And Related Function Documentation

ostream& operator<< ostream &  os,
const SxSent sent
[friend]
 

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.

Parameters:
os The output stream.
sent The sentence to output.
Returns:
The output stream.

istream& operator>> istream &  is,
SxSent sent
[friend]
 

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.

Parameters:
is The input stream.
sent The sentence object which will be read from the stream.
Returns:
The input stream.
See also:
isValid()


The documentation for this class was generated from the following files:
Generated on Mon Feb 21 08:53:16 2005 by doxygen 1.3.6