MorphologyEngine.h header
#include <ew/app/MorphologyEngine.h>
Namespace ew::app
Functions
QString ew::app::applyInflectionRule(const QString &stem, const ew::core::InflectionRule &rule)
Applies one inflection rule to stem, building the inflected form: a prefix is prepended, a suffix appended, a circumfix wraps the stem (its "before|after" affix split on |), a replacement substitutes the whole word, and "none" leaves the stem unchanged.
QString ew::app::inflect(const ew::core::Grammar &grammar, const QString &word, const QString &appliesTo, const QString &feature)
Inflects word for the grammatical feature (e.g. "plural", "past") using grammar: finds the paradigm that applies to appliesTo (a part of speech or inflection class) and the rule for the feature, then applies it. Returns word unchanged when the grammar has no such paradigm or the paradigm has no cell for the feature (so an uninflected word passes through).
QString ew::app::spellNumber(const ew::core::NumberSystem &system, int value)
Spells the non-negative integer value in system's counting base, composing the numeral words: a value with its own word is returned directly; otherwise it is decomposed by the system's place words (the base and its powers) from largest to smallest, each place prefixed by its coefficient word when greater than one, with the remainder spelled after. A value that cannot be fully realized from the available words falls back to its decimal digits for the missing parts. Returns an empty string for a negative value or an empty system.