FreeLing  4.0
Public Member Functions
freeling::same_word Class Reference

Class same_word represents the same word relation: two words are related if they are the same word. More...

#include <relation.h>

Inheritance diagram for freeling::same_word:
Inheritance graph
[legend]
Collaboration diagram for freeling::same_word:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 same_word (std::wstring expr)
 Constructor.
double get_homogeneity_index (const std::list< word_pos > &words, const std::list< related_words > &relations, const std::unordered_map< std::wstring, std::pair< int, word_pos * > > &unique_words) const
 Computes the homogeinity index of the given structures using the specific formula of this relation.
bool compute_word (const freeling::word &w, const freeling::sentence &s, const freeling::document &doc, int n_paragraph, int n_sentence, int position, std::list< word_pos > &words, std::list< related_words > &relations, std::unordered_map< std::wstring, std::pair< int, word_pos * > > &unique_words) const
 Returns true and stores the word w in the list words, list relations and unordered_map unique_words if w is compatible with the words in these structures using this relation.
std::list< word_posorder_words_by_weight (const std::unordered_map< std::wstring, std::pair< int, word_pos * > > &unique_words) const
 In same_word, the words in unique_words are not sorted because there is just one word.

Detailed Description

Class same_word represents the same word relation: two words are related if they are the same word.


Constructor & Destructor Documentation

freeling::same_word::same_word ( std::wstring  expr)

Constructor.


Member Function Documentation

bool freeling::same_word::compute_word ( const freeling::word w,
const freeling::sentence s,
const freeling::document doc,
int  n_paragraph,
int  n_sentence,
int  position,
std::list< word_pos > &  words,
std::list< related_words > &  relations,
std::unordered_map< std::wstring, std::pair< int, word_pos * > > &  unique_words 
) const [virtual]

Returns true and stores the word w in the list words, list relations and unordered_map unique_words if w is compatible with the words in these structures using this relation.

Implements freeling::relation.

double freeling::same_word::get_homogeneity_index ( const std::list< word_pos > &  words,
const std::list< related_words > &  relations,
const std::unordered_map< std::wstring, std::pair< int, word_pos * > > &  unique_words 
) const [virtual]

Computes the homogeinity index of the given structures using the specific formula of this relation.

Implements freeling::relation.

std::list<word_pos> freeling::same_word::order_words_by_weight ( const std::unordered_map< std::wstring, std::pair< int, word_pos * > > &  unique_words) const [virtual]

In same_word, the words in unique_words are not sorted because there is just one word.

It returns the word_pos in unique_words in a list.

Implements freeling::relation.


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