The class dictionary implements dictionary search and suffix analysis for word forms. More...
#include <dictionary.h>
Public Member Functions | |
dictionary (const std::string &, const std::string &, bool, const std::string &) | |
Constructor. | |
~dictionary () | |
Destructor. | |
void | search_form (const std::string &, std::list< analysis > &) |
Get the analysis list from a given form. | |
void | annotate (sentence &) |
Search words in sentence using default options. | |
Private Member Functions | |
void | annotate_word (word &) |
Fills the analysis list of a word and checks for suffixes. | |
bool | check_contracted (const word &, 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 | |
affixes * | suf |
suffix analyzer | |
database | morfodb |
C++ Interface to BerkeleyDB C API to acces the dictionary. |
The class dictionary implements dictionary search and suffix analysis for word forms.
dictionary::dictionary | ( | const std::string & | Lang, | |
const std::string & | dicFile, | |||
bool | activateAff, | |||
const std::string & | sufFile | |||
) |
Constructor.
Create a dictionary module, open database.
References AffixAnalysis, morfodb, database::open_database(), suf, and TRACE.
dictionary::~dictionary | ( | ) |
Destructor.
Destroy dictionary module, close database.
References database::close_database(), morfodb, and suf.
void dictionary::annotate | ( | sentence & | se | ) |
Search words in sentence using default options.
Dictionary search and affix analysis for all words in a sentence, using given options.
References annotate_word(), check_contracted(), TRACE, and TRACE_SENTENCE.
Referenced by maco::analyze().
void dictionary::annotate_word | ( | word & | w | ) | [private] |
Fills the analysis list of a word and checks for suffixes.
Search form in the dictionary, according to given options, Add* found analysis to the given word.
References AffixAnalysis, affixes::look_for_affixes(), search_form(), suf, and TRACE.
Referenced by annotate().
bool dictionary::check_contracted | ( | const word & | w, | |
std::list< word > & | lw | |||
) | [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 ERROR_CRASH, search_form(), TRACE, and WARNING.
Referenced by annotate().
void dictionary::search_form | ( | const std::string & | s, | |
std::list< analysis > & | la | |||
) |
Get the analysis list from a given form.
Search form in the dictionary, according to given options, Add* found analysis to the given list.
References database::access_database(), morfodb, and TRACE.
Referenced by annotate_word(), check_contracted(), and affixes::CheckRetokenizable().
bool dictionary::AffixAnalysis [private] |
configuration options
Referenced by annotate_word(), and dictionary().
database dictionary::morfodb [private] |
C++ Interface to BerkeleyDB C API to acces the dictionary.
Referenced by dictionary(), search_form(), and ~dictionary().
affixes* dictionary::suf [private] |
suffix analyzer
Referenced by annotate_word(), dictionary(), and ~dictionary().