FreeLing  3.0
Public Member Functions | Private Member Functions | Private Attributes
sentence Class Reference

Class sentence is just a list of words that someone (the splitter) has validated it as a complete sentence. More...

#include <language.h>

Inheritance diagram for sentence:
Inheritance graph
[legend]
Collaboration diagram for sentence:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 sentence ()
 Class sentence is just a list of words that someone (the splitter) has validated it as a complete sentence.
 sentence (const std::list< word > &)
 sentence (const sentence &)
 Copy constructor.
sentenceoperator= (const sentence &)
 assignment
const wordoperator[] (size_t) const
 positional access to a word
wordoperator[] (size_t)
unsigned int num_kbest () const
 find out how many kbest sequences the tagger computed
void push_back (const word &)
 add a word to the sentence
void rebuild_word_index ()
 rebuild word positional index
void clear ()
 Clear sentence and possible trees.
void set_parse_tree (const parse_tree &, int k=0)
 Set the parse tree.
parse_treeget_parse_tree (int k=0)
 Obtain the parse tree.
const parse_treeget_parse_tree (int k=0) const
bool is_parsed () const
 Find out whether the sentence is parsed.
void set_dep_tree (const dep_tree &, int k=0)
 Set the dependency tree.
dep_treeget_dep_tree (int k=0)
 Obtain the parse dependency tree.
const dep_treeget_dep_tree (int k=0) const
bool is_dep_parsed () const
 Find out whether the sentence is dependency parsed.
std::vector< wordget_words () const
 get word list (useful for perl API)
sentence::iterator words_begin ()
 get iterators to word list (useful for perl/java API)
sentence::const_iterator words_begin () const
sentence::iterator words_end ()
sentence::const_iterator words_end () const

Private Member Functions

void clone (const sentence &)
 clone sentence (used by assignment/copy constructors)

Private Attributes

std::vector< word * > wpos
std::map< int, parse_treepts
std::map< int, dep_treedts

Detailed Description

Class sentence is just a list of words that someone (the splitter) has validated it as a complete sentence.

It may include a parse tree.


Constructor & Destructor Documentation

Class sentence is just a list of words that someone (the splitter) has validated it as a complete sentence.

It may include a parse tree. Create a new sentence.

References dts, pts, and wpos.

sentence::sentence ( const std::list< word > &  )
sentence::sentence ( const sentence s)

Copy constructor.

References clone().


Member Function Documentation

void sentence::clear ( )

Clear sentence and possible trees.

References dts, pts, and wpos.

Referenced by clone().

void sentence::clone ( const sentence s) [private]

clone sentence (used by assignment/copy constructors)

Clone sentence.

References clear(), dts, pts, push_back(), and wpos.

Referenced by operator=(), and sentence().

dep_tree & sentence::get_dep_tree ( int  k = 0)

Obtain the parse dependency tree.

References dts.

const dep_tree & sentence::get_dep_tree ( int  k = 0) const

References dts.

Obtain the parse tree.

References pts.

Referenced by dep_txala::analyze().

const parse_tree & sentence::get_parse_tree ( int  k = 0) const

References pts.

get word list (useful for perl API)

obtain list of words (useful for perl APIs)

Find out whether the sentence is dependency parsed.

References dts.

Find out whether the sentence is parsed.

References pts.

unsigned int sentence::num_kbest ( ) const

find out how many kbest sequences the tagger computed

Referenced by dep_txala::analyze().

sentence & sentence::operator= ( const sentence s)

assignment

Assignment.

References clone().

const word & sentence::operator[] ( size_t  i) const

positional access to a word

References wpos.

word & sentence::operator[] ( size_t  i)

References wpos.

void sentence::push_back ( const word w)

add a word to the sentence

References wpos.

Referenced by clone().

rebuild word positional index

rebuild word index by position

References wpos.

Referenced by bioner::analyze(), dictionary::analyze(), automat::analyze(), and POS_tagger::retokenize().

void sentence::set_dep_tree ( const dep_tree tr,
int  k = 0 
)

Set the dependency tree.

References dts.

Referenced by dep_txala::analyze().

void sentence::set_parse_tree ( const parse_tree tr,
int  k = 0 
)

Set the parse tree.

References pts.

Referenced by dep_txala::analyze().

sentence::iterator sentence::words_begin ( )

get iterators to word list (useful for perl/java API)

obtain iterators (useful for perl/java APIs)

sentence::const_iterator sentence::words_begin ( ) const
sentence::iterator sentence::words_end ( )
sentence::const_iterator sentence::words_end ( ) const

Member Data Documentation

std::map<int,dep_tree> sentence::dts [private]
std::map<int,parse_tree> sentence::pts [private]
std::vector<word*> sentence::wpos [private]

The documentation for this class was generated from the following files: