FreeLing
4.0
|
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::vector< predicate > | predicates |
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. | |
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. | |
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_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 |
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 predicate & | get_predicate_by_pos (int n) const |
get predicate for word at position p | |
const predicate & | get_predicate_by_number (int n) const |
get predicate number n | |
const predicates & | get_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_tree > | pts |
std::map< int, dep_tree > | dts |
std::list< processor_status * > | status |
predicates | preds |
std::map< int, int > | pred_index |
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::vector<predicate> freeling::sentence::predicates |
Destructor.
References clear().
freeling::sentence::sentence | ( | const std::list< word > & | ) |
freeling::sentence::sentence | ( | const sentence & | s | ) |
Copy constructor.
References clone().
void freeling::sentence::add_predicate | ( | const predicate & | pr | ) |
add a predicate to the sentence
References freeling::predicate::get_position(), pred_index, and preds.
void freeling::sentence::clear | ( | ) |
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().
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 | ) |
Obtain the parse tree.
References pts.
const parse_tree & freeling::sentence::get_parse_tree | ( | int | k = 0 | ) | const |
References pts.
const predicate & freeling::sentence::get_predicate_by_number | ( | int | n | ) | const |
get predicate number n
References preds.
const predicate & freeling::sentence::get_predicate_by_pos | ( | int | n | ) | const |
get predicate for word at position p
References get_predicate_number(), and preds.
int freeling::sentence::get_predicate_number | ( | int | p | ) | const |
get predicate number n for word in position p
References pred_index.
Referenced by get_predicate_by_pos().
int freeling::sentence::get_predicate_position | ( | int | n | ) | const |
get word position for predicate number n
References preds.
const sentence::predicates & freeling::sentence::get_predicates | ( | ) | const |
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().
const processor_status * freeling::sentence::get_processing_status | ( | ) | const |
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 |
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 |
bool freeling::sentence::is_predicate | ( | int | p | ) | const |
see if word in given position is a predicate
References pred_index.
bool freeling::sentence::is_tagged | ( | ) | const |
References tagged.
unsigned int freeling::sentence::num_kbest | ( | ) | const |
find out how many kbest sequences the tagger computed
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 |
||
) |
Set the dependency tree.
References dts.
void freeling::sentence::set_is_tagged | ( | bool | b | ) |
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 |
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,int> freeling::sentence::pred_index [private] |
Referenced by add_predicate(), clear(), clone(), get_predicate_number(), is_predicate(), and sentence().
predicates freeling::sentence::preds [private] |
Referenced by add_predicate(), clear(), clone(), get_predicate_by_number(), get_predicate_by_pos(), get_predicate_position(), get_predicates(), and sentence().
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().
bool freeling::sentence::tagged [private] |
Referenced by clone(), is_tagged(), sentence(), and set_is_tagged().
std::vector<word*> freeling::sentence::wpos [private] |
Referenced by clear(), clone(), operator[](), push_back(), rebuild_word_index(), and sentence().