This class ends the morphological analysis subchain, and has two functions: first, it assigns an a priori probability to each analysis of each word. These probablities will be needed for the PoS tagger later. Second, if a word has no analysis (none of the previously applied modules succeeded to analyze it), this module tries to guess which are its possible PoS tags, based on the word ending.
class probabilities { public: /// Constructor: receives the language code, the name of the file // containing probabilities, and a threshold. probabilities(const std::string &, const std::string &, double); /// Assign probabilities to all analysis of each word in sentence void annotate(sentence &); /// Assign probabilities to all analysis of given word void annotate_word(word &); };
The constructor receives: