|
| std::u32string | to_lower (const std::u32string &src) |
| | Lowercases code point by code point (ICU simple case mapping, any script).
|
| std::u32string | utf8_to_u32 (const std::string &src) |
| std::string | u32_to_utf8 (const std::u32string &src) |
| edit_rule_t | extract_rule (const std::u32string &form, const std::u32string &lemma) |
| | The rule turning form into lemma that keeps the longest common prefix: lowercasing is part of the rule only when it shortens the edit ("Princes" -> "prince" is {true, 1, ""}, "Paris" -> "Paris" is {false, 0, ""}).
|
| size_t | edit_cost (const affix_rule_t &r) |
| | The length of the edit: characters stripped and added at both ends.
|
| affix_rule_t | extract_substring_rule (const std::u32string &form, const std::u32string &lemma, bool lower) |
| | The edit turning form into lemma around their longest common substring, the earliest one in form, then in lemma, on equal lengths.
|
| affix_rule_t | extract_affix_rule (const std::u32string &form, const std::u32string &lemma, size_t max_prefix) |
| | The rule turning form into lemma with a prefix edit stripping at most max_prefix characters: the suffix rule of extract_rule unless an edit around the longest common substring is strictly shorter.
|
| bool | apply_rule (const std::u32string &form, const edit_rule_t &prefix, const edit_rule_t &suffix, std::u32string &lemma) |
| | Applies the prefix and suffix rules to form.
|
| bool | apply_rule (const std::u32string &form, const edit_rule_t &rule, std::u32string &lemma) |
| | Applies a suffix rule alone (see above).
|
| const std::string & | any_feats () |
| | The feats value of the rule used when no rule matches the exact features.
|
| std::vector< std::string > | split_tabs (const std::string &line) |
| | Splits on tabs, keeping empty fields (utils::split drops them).
|
| void | read_rules (std::istream &in, const std::function< void(const rule_line_t &)> &fn) |
| | Reads a rules file, calling fn(const rule_line_t&) on each rule.
|
| edit_rule_t deeplima::lemmatization::extract_rule |
( |
const std::u32string & | form, |
|
|
const std::u32string & | lemma ) |
|
inline |
The rule turning form into lemma that keeps the longest common prefix: lowercasing is part of the rule only when it shortens the edit ("Princes" -> "prince" is {true, 1, ""}, "Paris" -> "Paris" is {false, 0, ""}).
Definition at line 128 of file lemm_rules.h.