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::conlang::InterlinearGloss::source
The source passage, one token per word (the surface line).
QString ew::app::conlang::InterlinearGloss::gloss
The aligned gloss line: each word as "meaning" or "meaning-FEATURE" (Leipzig conventions).
QString ew::app::conlang::InterlinearGloss::translation
A plain free translation (the root meanings in order; unknown words passed through).
std::vector<MorphAnalysis> ew::app::conlang::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). A compound decomposes into parts.
Members
QString ew::app::conlang::MorphAnalysis::surface
The word as it appeared in the text (its surface form).
QString ew::app::conlang::MorphAnalysis::root
The dictionary/root form the word reduces to (the surface itself when unrecognized).
QString ew::app::conlang::MorphAnalysis::rootGloss
The root's meaning (gloss) in the writer's language; empty when unrecognized.
QString ew::app::conlang::MorphAnalysis::feature
The grammatical feature realized by a stripped affix (e.g. "plural"); empty if none/uninflected.
bool ew::app::conlang::MorphAnalysis::recognized = false
Whether the word was recognized (directly or via affix-stripping) against the language.
bool ew::app::conlang::MorphAnalysis::oppositePolarity = false
Whether the whole word carried the orthography's polarity mark, so it was read as its opposite pole. For a compound the flag lives per root, on parts.
std::vector<MorphAnalysisPart> ew::app::conlang::MorphAnalysis::parts
For a COMPOUND, the roots it decomposes into, in order, each as its own analysis. Empty for a word that is itself a headword or an inflected form of one.
A polysynthetic language builds every word from roots, and a whole clause can be one word, so without decomposition an interlinear gloss returns the compound verbatim and unanalysed – the one thing the three-line format exists to prevent.
bool ew::app::conlang::MorphAnalysis::operator==(const MorphAnalysis &other) const =default
Value equality over all fields.
MorphAnalysisPart struct
struct ew::app::MorphAnalysisPart
One root inside a compound: the root as written and what it means.
Members
QString ew::app::conlang::MorphAnalysisPart::root
The root's dictionary form.
QString ew::app::conlang::MorphAnalysisPart::gloss
The root's meaning in the writer's language.
QString ew::app::conlang::MorphAnalysisPart::feature
The grammatical feature this root realizes, when a paradigm marks the feature with a whole ROOT rather than an affix (AffixType::Root) – e.g. "past". Empty for an ordinary root.
bool ew::app::conlang::MorphAnalysisPart::oppositePolarity = false
Whether this root carried the orthography's polarity mark, so it was read as its opposite pole. Only this root: a chain marks the inverted roots individually.
bool ew::app::conlang::MorphAnalysisPart::operator==(const MorphAnalysisPart &other) const =default
Value equality over all fields.
Functions
MorphAnalysis ew::app::conlang::analyzeWord(const ew::core::conlang::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. Case and the punctuation around the word are ignored when matching, where a word is what isConlangWordChar defines – so a headword spelled with an edge apostrophe or hyphen (ka', -ith) is matched as itself, and a word the writer quoted is matched by its letters.
InterlinearGloss ew::app::conlang::glossPassage(const ew::core::conlang::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::conlang::reorderClause(const ew::core::conlang::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).