![]() |
LIMA
Libre Multilingual Analyzer — C++ API
|
Rules ready for lookup, keyed by K, the analyzer's encoding of UPOS(+FEATS) (morph_feats_t in TokenSequenceAnalyzer, strings in tests). More...
#include <deeplima/lemmatization/lemm_rules.h>
Public Member Functions | |
| void | add (const K &key, const std::u32string &affix, const edit_rule_t &rule, size_t count, bool fallback, bool prefix=false) |
| Adds a rule to the exact or the fallback table, of the suffixes or of the beginnings (prefix, affix then being the word's beginning); of two rules under the same key, the most supported one stays. | |
| bool | empty () const |
| size_t | size () const |
| bool | lemmatize (const K &exact, const K &fallback, const std::u32string &form, std::u32string &lemma) const |
| Lemmatizes form with the rule of its longest known ending, the exact features before the UPOS-only fallback at equal length, and then the rule of its longest known beginning likewise (none: the beginning is kept). | |
Rules ready for lookup, keyed by K, the analyzer's encoding of UPOS(+FEATS) (morph_feats_t in TokenSequenceAnalyzer, strings in tests).
Exact-features rules and UPOS-only fallback rules are kept apart, for the suffixes and the beginnings alike: in the analyzer a word without features ("NOUN _") and the fallback ("NOUN *") encode to the same key, and sharing one table let the fallback overwrite the exact rule.
Definition at line 439 of file lemm_rules.h.
|
inline |
Adds a rule to the exact or the fallback table, of the suffixes or of the beginnings (prefix, affix then being the word's beginning); of two rules under the same key, the most supported one stays.
Definition at line 447 of file lemm_rules.h.
|
inline |
Definition at line 460 of file lemm_rules.h.
|
inline |
Lemmatizes form with the rule of its longest known ending, the exact features before the UPOS-only fallback at equal length, and then the rule of its longest known beginning likewise (none: the beginning is kept).
A rule stripping more than the form leaves is passed over for a shorter key.
Definition at line 469 of file lemm_rules.h.
|
inline |
Definition at line 461 of file lemm_rules.h.