|
FreeLing
3.0
|
The class dictionary implements dictionary search and suffix analysis for word forms. More...
#include <dictionary.h>


Public Member Functions | |
| dictionary (const std::wstring &, const std::wstring &, bool, const std::wstring &, bool invDic=false, bool retok=true) | |
| Constructor. | |
| ~dictionary () | |
| Destructor. | |
| void | search_form (const std::wstring &, std::list< analysis > &) |
| Get dictionary entry for a given form, add to given list. | |
| bool | annotate_word (word &, std::list< word > &) |
| Fills the analysis list of a word, checking for suffixes and contractions. | |
| std::list< std::wstring > | get_forms (const std::wstring &, const std::wstring &) const |
| Get possible forms for a lemma+pos. | |
| void | analyze (sentence &) |
| analyze given sentence | |
| void | analyze (std::list< sentence > &) |
| analyze given sentences | |
| sentence | analyze (const sentence &) |
| analyze sentence, return analyzed copy | |
| std::list< sentence > | analyze (const std::list< sentence > &) |
| analyze sentences, return analyzed copy | |
Private Member Functions | |
| bool | check_contracted (const std::wstring &, std::wstring, std::wstring, std::list< word > &) |
| check whether the word is a contraction, and if so, fill the list with the contracted words | |
Private Attributes | |
| bool | AffixAnalysis |
| configuration options | |
| bool | InverseDict |
| bool | RetokenizeContractions |
| affixes * | suf |
| suffix analyzer | |
| database * | morfodb |
| key-value file or hash | |
| database * | inverdb |
The class dictionary implements dictionary search and suffix analysis for word forms.
| dictionary::dictionary | ( | const std::wstring & | Lang, |
| const std::wstring & | dicFile, | ||
| bool | activateAff, | ||
| const std::wstring & | sufFile, | ||
| bool | invDic = false, |
||
| bool | retok = true |
||
| ) |
Constructor.
Create a dictionary module, open database.
References DB_MAP, DB_PREFTREE, ERROR_CRASH, util::open_utf8_file(), TRACE, and util::wstring2list().
Destructor.
Destroy dictionary module, close database.
| void dictionary::analyze | ( | sentence & | se | ) | [virtual] |
analyze given sentence
Dictionary search and affix analysis for all words in a sentence, using given options.
Implements processor.
References util::int2wstring(), sentence::rebuild_word_index(), TRACE, and TRACE_SENTENCE.
Referenced by maco::analyze().
| void dictionary::analyze | ( | std::list< sentence > & | ) |
analyze given sentences
Reimplemented from processor.
| sentence dictionary::analyze | ( | const sentence & | s | ) |
analyze sentence, return analyzed copy
Look up in given sentence for punctuation.
Return copy
Reimplemented from processor.
References processor::analyze().
| std::list<sentence> dictionary::analyze | ( | const std::list< sentence > & | ) |
analyze sentences, return analyzed copy
Reimplemented from processor.
| bool dictionary::annotate_word | ( | word & | , |
| std::list< word > & | |||
| ) |
Fills the analysis list of a word, checking for suffixes and contractions.
Search form in the dictionary, according to given options, Add* found analysis to the given word.
Returns true iff the form is a contraction.
Return true iff word is a contraction.
References word::add_analysis(), word::get_form(), word::get_n_analysis(), util::int2wstring(), word::set_found_in_dict(), TRACE, and WARNING.
| bool dictionary::check_contracted | ( | const std::wstring & | , |
| std::wstring | , | ||
| std::wstring | , | ||
| std::list< word > & | |||
| ) | [private] |
check whether the word is a contraction, and if so, fill the list with the contracted words
Check whether the given word is a contraction, if so, obtain composing words (and store them into lw).
References word::add_analysis(), util::capitalization(), util::capitalize(), ERROR_CRASH, word::get_n_analysis(), util::list2wstring(), TRACE, util::uppercase(), and util::wstring2list().
| list< wstring > dictionary::get_forms | ( | const std::wstring & | , |
| const std::wstring & | |||
| ) | const |
Get possible forms for a lemma+pos.
References WARNING, and util::wstring2list().
| void dictionary::search_form | ( | const std::wstring & | s, |
| std::list< analysis > & | la | ||
| ) |
Get dictionary entry for a given form, add to given list.
Search form in the dictionary, according to given options, Add* found analysis to the given list.
References util::int2wstring(), util::list2wstring(), util::lowercase(), TRACE, and util::wstring2list().
Referenced by affixes::CheckRetokenizable(), and affixes::SearchRootsList().
bool dictionary::AffixAnalysis [private] |
configuration options
database* dictionary::inverdb [private] |
bool dictionary::InverseDict [private] |
database* dictionary::morfodb [private] |
key-value file or hash
bool dictionary::RetokenizeContractions [private] |
affixes* dictionary::suf [private] |
suffix analyzer
1.7.6.1