FreeLing
3.1
|
Class sentence is just a list of words that someone (the splitter) has validated it as a complete sentence. More...
#include <language.h>
Public Types | |
typedef std::pair < std::wstring, std::map< int, std::wstring > > | pred_arg_set |
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. | |
sentence & | operator= (const sentence &) |
assignment | |
const word & | operator[] (size_t) const |
positional access to a word | |
word & | operator[] (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. | |
std::wstring | get_sentence_id () |
Get sentence identifier. | |
void | set_parse_tree (const parse_tree &, int k=0) |
Set the parse tree. | |
parse_tree & | get_parse_tree (int k=0) |
Obtain the parse tree. | |
const parse_tree & | get_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_tree & | get_dep_tree (int k=0) |
Obtain the parse dependency tree. | |
const dep_tree & | get_dep_tree (int k=0) const |
bool | is_dep_parsed () const |
Find out whether the sentence is dependency parsed. | |
processor_status * | get_processing_status () |
get status at the top of stack | |
const processor_status * | get_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< word > | get_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 |
Public Attributes | |
std::map< int, pred_arg_set > | pred_args |
Private Member Functions | |
void | clone (const sentence &) |
Clone sentence. | |
Private Attributes | |
std::wstring | sent_id |
std::vector< word * > | wpos |
std::map< int, parse_tree > | pts |
std::map< int, dep_tree > | dts |
std::list< processor_status * > | status |
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.
typedef std::pair<std::wstring, std::map<int,std::wstring> > freeling::sentence::pred_arg_set |
freeling::sentence::sentence | ( | const std::list< word > & | ) |
freeling::sentence::sentence | ( | const sentence & | s | ) |
Copy constructor.
References clone().
void freeling::sentence::clear | ( | ) |
pop top status, and free it
References status.
Referenced by freeling::dep_txala::analyze(), clear(), and freeling::automat< quantities_status >::matching().
void freeling::sentence::clone | ( | const sentence & | s | ) | [private] |
Clone sentence.
References clear(), dts, pts, push_back(), sent_id, status, and wpos.
Referenced by operator=(), and sentence().
dep_tree & freeling::sentence::get_dep_tree | ( | int | k = 0 | ) |
Obtain the parse dependency tree.
References dts.
const dep_tree & freeling::sentence::get_dep_tree | ( | int | k = 0 | ) | const |
References dts.
parse_tree & freeling::sentence::get_parse_tree | ( | int | k = 0 | ) |
const parse_tree & freeling::sentence::get_parse_tree | ( | int | k = 0 | ) | const |
References pts.
get status at the top of stack
get/set processing status
References status.
Referenced by freeling::automat< quantities_status >::BuildMultiword(), and freeling::locutions::ComputeToken().
const processor_status * freeling::sentence::get_processing_status | ( | ) | const |
References status.
wstring freeling::sentence::get_sentence_id | ( | ) |
Get sentence identifier.
References sent_id.
vector< word > freeling::sentence::get_words | ( | ) | const |
get word list (useful for perl API)
obtain list of words (useful for perl APIs)
bool freeling::sentence::is_dep_parsed | ( | ) | const |
Find out whether the sentence is dependency parsed.
References dts.
Referenced by rebuild_word_index().
bool freeling::sentence::is_parsed | ( | ) | const |
unsigned int freeling::sentence::num_kbest | ( | ) | const |
find out how many kbest sequences the tagger computed
Referenced by freeling::dep_txala::analyze().
const word & freeling::sentence::operator[] | ( | size_t | i | ) | const |
positional access to a word
References wpos.
void freeling::sentence::push_back | ( | const word & | w | ) |
rebuild word positional index
rebuild word index by position
References dts, is_dep_parsed(), is_parsed(), pts, and wpos.
Referenced by freeling::bioner::analyze(), freeling::dictionary::analyze(), freeling::automat< quantities_status >::analyze(), and freeling::POS_tagger::retokenize().
void freeling::sentence::set_dep_tree | ( | const dep_tree & | tr, |
int | k = 0 |
||
) |
void freeling::sentence::set_parse_tree | ( | const parse_tree & | tr, |
int | k = 0 |
||
) |
push status into the stack
References status.
Referenced by freeling::dep_txala::analyze(), and 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 |
std::map<int,dep_tree> freeling::sentence::dts [private] |
Referenced by clear(), clone(), get_dep_tree(), is_dep_parsed(), rebuild_word_index(), sentence(), and set_dep_tree().
std::map<int,pred_arg_set> freeling::sentence::pred_args |
std::map<int,parse_tree> freeling::sentence::pts [private] |
Referenced by clear(), clone(), get_parse_tree(), is_parsed(), rebuild_word_index(), sentence(), and set_parse_tree().
std::wstring freeling::sentence::sent_id [private] |
Referenced by clone(), get_sentence_id(), sentence(), and set_sentence_id().
std::list<processor_status*> freeling::sentence::status [private] |
Referenced by clear(), clear_processing_status(), clone(), get_processing_status(), sentence(), and set_processing_status().
std::vector<word*> freeling::sentence::wpos [private] |
Referenced by clear(), clone(), operator[](), push_back(), rebuild_word_index(), and sentence().