|
FreeLing
4.0
|
Class same_word represents the same word relation: two words are related if they are the same word. More...
#include <relation.h>


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_pos > | order_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. | |
Class same_word represents the same word relation: two words are related if they are the same word.
| freeling::same_word::same_word | ( | std::wstring | expr | ) |
Constructor.
| 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.
1.7.6.1