ConlangGloss.h header
#include <ew/app/ConlangGloss.h>
Namespace ew::app
InterlinearGloss struct
struct ew::app::InterlinearGloss
A three-line interlinear (Leipzig-style) gloss of a passage: the original words, the aligned morpheme-by-morpheme gloss (root meaning plus grammatical-category abbreviations), and a free translation into the writer's language.
Members
QString ew::app::InterlinearGloss::source
The source passage, one token per word (the surface line).
QString ew::app::InterlinearGloss::gloss
The aligned gloss line: each word as "meaning" or "meaning-FEATURE" (Leipzig conventions).
QString ew::app::InterlinearGloss::translation
A plain free translation (the root meanings in order; unknown words passed through).
std::vector<MorphAnalysis> ew::app::InterlinearGloss::words
The per-word analyses backing the gloss, in order.
MorphAnalysis struct
struct ew::app::MorphAnalysis
The morphological analysis of one word written in a constructed language: how it breaks down into a known root plus (optionally) an inflectional feature. recognized is true when the word was found in the lexicon directly or by stripping a known affix; root is the dictionary form, rootGloss its meaning, and feature the grammatical feature realized by any stripped affix (empty for an uninflected word).
Members
QString ew::app::MorphAnalysis::surface
The word as it appeared in the text (its surface form).
QString ew::app::MorphAnalysis::root
The dictionary/root form the word reduces to (the surface itself when unrecognized).
QString ew::app::MorphAnalysis::rootGloss
The root's meaning (gloss) in the writer's language; empty when unrecognized.
QString ew::app::MorphAnalysis::feature
The grammatical feature realized by a stripped affix (e.g. "plural"); empty if none/uninflected.
bool ew::app::MorphAnalysis::recognized = false
Whether the word was recognized (directly or via affix-stripping) against the language.
bool ew::app::MorphAnalysis::operator==(const MorphAnalysis &other) const =default
Value equality over all fields.
Functions
MorphAnalysis ew::app::analyzeWord(const ew::core::Language &language, const QString &word)
Analyses word against language: returns a direct lexicon match, or – failing that – strips a known inflectional affix (from the grammar's paradigms) to recover a root that is in the lexicon, recording the feature the affix realized. When nothing matches, the analysis is marked unrecognized with the surface form as its own root. Surrounding punctuation and case are ignored when matching.
InterlinearGloss ew::app::glossPassage(const ew::core::Language &language, const QString &conlangText)
Produces a three-line interlinear gloss of conlangText (a passage written in language), analysing each word morphologically so that inflected forms gloss as "root-FEATURE".
QString ew::app::reorderClause(const ew::core::Grammar &grammar, const QString &subject, const QString &verb, const QString &object)
Orders the three clause constituents according to grammar's constituent word order (SOV, VSO, ...), joining the non-empty parts with spaces. This applies the grammar's syntax to already-identified subject/verb/object phrases (a free word order keeps subject-verb-object order).