FreeLing  4.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes
freeling::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 freeling::sentence:
Inheritance graph
[legend]
Collaboration diagram for freeling::sentence:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::vector< predicatepredicates

Public Member Functions

 sentence ()
 Class sentence is just a list of words that someone (the splitter) has validated it as a complete sentence.
 ~sentence ()
 Destructor.
 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_sentence_id (const std::wstring &)
 Set sentence identifier.
const std::wstring & get_sentence_id () const
 Get sentence identifier.
void set_is_tagged (bool)
bool is_tagged () const
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.
processor_statusget_processing_status ()
 get status at the top of stack
const processor_statusget_processing_status () const
void set_processing_status (processor_status *)
 push status into the stack
void clear_processing_status ()
 pop top status, and free it
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
sentence::iterator get_word_iterator (const word &w)
sentence::const_iterator get_word_iterator (const word &w) const
void add_predicate (const predicate &pr)
 add a predicate to the sentence
bool is_predicate (int p) const
 see if word in given position is a predicate
int get_predicate_number (int p) const
 get predicate number n for word in position p
int get_predicate_position (int n) const
 get word position for predicate number n
const predicateget_predicate_by_pos (int n) const
 get predicate for word at position p
const predicateget_predicate_by_number (int n) const
 get predicate number n
const predicatesget_predicates () const
 get predicates of the sentence (e.g. to iterate over them)

Private Member Functions

void clone (const sentence &)
 Clone sentence.

Private Attributes

std::wstring sent_id
std::vector< word * > wpos
bool tagged
std::map< int, parse_treepts
std::map< int, dep_treedts
std::list< processor_status * > status
predicates preds
std::map< int, intpred_index

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.


Member Typedef Documentation


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, pred_index, preds, pts, sent_id, status, tagged, and wpos.

Destructor.

References clear().

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

Copy constructor.

References clone().


Member Function Documentation

add a predicate to the sentence

References freeling::predicate::get_position(), pred_index, and preds.

Clear sentence and possible trees.

References clear_processing_status(), dts, pred_index, preds, pts, status, and wpos.

Referenced by clone(), and ~sentence().

pop top status, and free it

References status.

Referenced by clear(), and freeling::automat< quantities_status >::matching().

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

Clone sentence.

References clear(), dts, pred_index, preds, pts, push_back(), sent_id, status, tagged, and wpos.

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

Obtain the parse dependency tree.

References dts.

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

References dts.

Obtain the parse tree.

References pts.

References pts.

get predicate number n

References preds.

get predicate for word at position p

References get_predicate_number(), and preds.

get predicate number n for word in position p

References pred_index.

Referenced by get_predicate_by_pos().

get word position for predicate number n

References preds.

get predicates of the sentence (e.g. to iterate over them)

get predicates of the sentence

References preds.

get status at the top of stack

get/set processing status

References status.

Referenced by freeling::locutions::ComputeToken().

References status.

const wstring & freeling::sentence::get_sentence_id ( ) const

Get sentence identifier.

References sent_id.

sentence::iterator freeling::sentence::get_word_iterator ( const word w)
sentence::const_iterator freeling::sentence::get_word_iterator ( const word w) const

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.

Referenced by rebuild_word_index().

Find out whether the sentence is parsed.

References pts.

Referenced by rebuild_word_index().

see if word in given position is a predicate

References pred_index.

References tagged.

unsigned int freeling::sentence::num_kbest ( ) const

find out how many kbest sequences the tagger computed

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

assignment

Assignment.

References clone().

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

positional access to a word

References wpos.

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

References wpos.

void freeling::sentence::push_back ( const word w)

add a word to the sentence

References wpos.

Referenced by clone().

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

Set the dependency tree.

References dts.

References tagged.

Referenced by freeling::POS_tagger::analyze().

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

Set the parse tree.

References pts.

push status into the stack

References status.

Referenced by freeling::automat< quantities_status >::matching().

void freeling::sentence::set_sentence_id ( const std::wstring &  )

Set sentence identifier.

References sent_id.

sentence::iterator freeling::sentence::words_begin ( )

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

obtain iterators (useful for perl/java APIs)

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

Member Data Documentation

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

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