FreeLing  4.0
Public Member Functions | Private Attributes
freeling::lexical_chain Class Reference

Class lexical_chain represents a lexical chain and computes words and stores (or not) them into the structures. More...

#include <lexical_chain.h>

Collaboration diagram for freeling::lexical_chain:
Collaboration graph
[legend]

List of all members.

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_posget_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_poswords
 List of words embedded in a word_pos struct.
relationrel
 Pointer to the relation that this lexical chain uses.
std::list< related_wordsrelations
 List of relations between words.

Detailed Description

Class lexical_chain represents a lexical chain and computes words and stores (or not) them into the structures.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Get all the words ordered by frequency.

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.

Get a string representation of the lexical chain to debug.


Member Data Documentation

Pointer to the relation that this lexical chain uses.

List of relations between words.

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.

List of words embedded in a word_pos struct.


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