FreeLing
4.0
|
Class lexical_chain represents a lexical chain and computes words and stores (or not) them into the structures. More...
#include <lexical_chain.h>
Public Member Functions | |
lexical_chain (relation *r, const freeling::word &w, const freeling::sentence &s, int n_paragraph, int n_sentence, int position) | |
Constructor. | |
~lexical_chain () | |
Destructor. | |
bool | compute_word (const freeling::word &w, const freeling::sentence &s, const freeling::document &doc, int n_paragraph, int n_sentence, int position) |
Computes a word, if the word an be added to the lexical chain, this method stores it in its structures and return true. | |
double | get_score () |
Get the score of the lexical chain. | |
int | get_number_of_words () const |
Get the number of words inside the lexical chain. | |
const std::list< word_pos > & | get_words () const |
Get all the words embedded in a word_pos struct of the lexical chain. | |
std::list< word_pos > | get_ordered_words () const |
Get all the words ordered by frequency. | |
std::wstring | toString () |
Get a string representation of the lexical chain to debug. | |
Private Attributes | |
double | score |
Lexical chains score. | |
std::unordered_map < std::wstring, std::pair< int, word_pos * > > | unique_words |
Structure to keep track of the words frequency. | |
std::list< word_pos > | words |
List of words embedded in a word_pos struct. | |
relation * | rel |
Pointer to the relation that this lexical chain uses. | |
std::list< related_words > | relations |
List of relations between words. |
Class lexical_chain represents a lexical chain and computes words and stores (or not) them into the structures.
freeling::lexical_chain::lexical_chain | ( | relation * | r, |
const freeling::word & | w, | ||
const freeling::sentence & | s, | ||
int | n_paragraph, | ||
int | n_sentence, | ||
int | position | ||
) |
Constructor.
Destructor.
bool freeling::lexical_chain::compute_word | ( | const freeling::word & | w, |
const freeling::sentence & | s, | ||
const freeling::document & | doc, | ||
int | n_paragraph, | ||
int | n_sentence, | ||
int | position | ||
) |
Computes a word, if the word an be added to the lexical chain, this method stores it in its structures and return true.
Otherwise, it does nothing and returns false.
Get the number of words inside the lexical chain.
std::list<word_pos> freeling::lexical_chain::get_ordered_words | ( | ) | const |
Get all the words ordered by frequency.
double freeling::lexical_chain::get_score | ( | ) |
Get the score of the lexical chain.
const std::list<word_pos>& freeling::lexical_chain::get_words | ( | ) | const |
Get all the words embedded in a word_pos struct of the lexical chain.
std::wstring freeling::lexical_chain::toString | ( | ) |
Get a string representation of the lexical chain to debug.
relation* freeling::lexical_chain::rel [private] |
Pointer to the relation that this lexical chain uses.
std::list<related_words> freeling::lexical_chain::relations [private] |
List of relations between words.
double freeling::lexical_chain::score [private] |
Lexical chains score.
std::unordered_map<std::wstring, std::pair<int, word_pos*> > freeling::lexical_chain::unique_words [private] |
Structure to keep track of the words frequency.
std::list<word_pos> freeling::lexical_chain::words [private] |