Language.h header
#include <ew/core/Language.h>
Namespace ew::core
Language class
class ew::core::Language
A constructed language ("conlang") as first-class worldbuilding content: its sound system (phonology), a persistent lexicon/dictionary of coined words with their meanings, and free-form grammar notes. Being a content object – not hidden metadata – a language can be listed, searched, shared through a mounted library, and edited undoably like anything else in the world, so the invented language behind the prose is a durable, first-class part of the project rather than a throwaway word list. The phonology fields mirror the app's conlang word generator so a language can seed fresh vocabulary consistent with its own sounds.
Members
ew::core::Language::Language(ContentId id, QString name)
Creates a language with identity id and display name name. The phonology starts empty (the UI seeds sensible defaults), grammar notes start empty, and the lexicon starts empty.
const QString & ew::core::Language::name() const
The language's display name.
void ew::core::Language::setName(QString name)
Sets the language's display name.
const QString & ew::core::Language::consonants() const
Space-separated consonant phonemes the language is built from.
void ew::core::Language::setConsonants(QString consonants)
Sets the consonant phonemes.
const QString & ew::core::Language::vowels() const
Space-separated vowel phonemes.
void ew::core::Language::setVowels(QString vowels)
Sets the vowel phonemes.
const QString & ew::core::Language::patterns() const
Space-separated syllable patterns (C = consonant slot, V = vowel slot; others literal).
void ew::core::Language::setPatterns(QString patterns)
Sets the syllable patterns.
int ew::core::Language::minSyllables() const
The fewest syllables a generated word may have.
void ew::core::Language::setMinSyllables(int minSyllables)
Sets the minimum syllable count per generated word.
int ew::core::Language::maxSyllables() const
The most syllables a generated word may have.
void ew::core::Language::setMaxSyllables(int maxSyllables)
Sets the maximum syllable count per generated word.
const QString & ew::core::Language::grammarNotes() const
Free-form grammar notes (Markdown permitted).
void ew::core::Language::setGrammarNotes(QString grammarNotes)
Sets the free-form grammar notes.
const std::vector< LexiconEntry > & ew::core::Language::lexicon() const
The language's dictionary, in display order.
void ew::core::Language::setLexicon(std::vector< LexiconEntry > lexicon)
Sets the language's dictionary.
const PhonemeInventory & ew::core::Language::inventory() const
The structured sound inventory (phonemes + suprasegmentals).
void ew::core::Language::setInventory(PhonemeInventory inventory)
Sets the structured sound inventory.
const Phonotactics & ew::core::Language::phonotactics() const
The structured phonotactics (categories, syllable templates, constraints, rewrite rules).
void ew::core::Language::setPhonotactics(Phonotactics phonotactics)
Sets the structured phonotactics.
const Orthography & ew::core::Language::orthography() const
The orthography (named romanization schemes over the inventory's default spelling).
void ew::core::Language::setOrthography(Orthography orthography)
Sets the orthography.
const std::vector< SoundChangeRuleset > & ew::core::Language::soundChanges() const
The diachronic sound-change rulesets that evolve this language into its daughters/dialects.
void ew::core::Language::setSoundChanges(std::vector< SoundChangeRuleset > soundChanges)
Sets the diachronic sound-change rulesets.
const Grammar & ew::core::Language::grammar() const
The structured grammar (typology, word order, paradigms, pronouns, number system).
void ew::core::Language::setGrammar(Grammar grammar)
Sets the structured grammar.
const WritingSystem & ew::core::Language::writingSystem() const
The constructed writing system (conscript): glyphs, direction, and ligatures.
void ew::core::Language::setWritingSystem(WritingSystem writing)
Sets the constructed writing system.
void ew::core::Language::addEntry(LexiconEntry entry)
Appends entry to the lexicon (a newly coined or glossed word).
LanguageFields ew::core::Language::fields() const
Returns the whole editable payload as a value snapshot (for undo/redo and serialization).
void ew::core::Language::setFields(LanguageFields fields)
Replaces the whole editable payload from fields in one step.
LanguageFields struct
struct ew::core::LanguageFields
The complete editable payload of a Language – everything a user can change – captured as a value so it can be snapshotted and restored in one step. Used by SetLanguageCommand for undo/redo and by the store for round-tripping.
Members
QString ew::core::LanguageFields::name
The language's display name (e.g. "High Elvish").
QString ew::core::LanguageFields::consonants
Space-separated consonant phonemes the language draws on (e.g. "p t k s m n l r").
QString ew::core::LanguageFields::vowels
Space-separated vowel phonemes (e.g. "a e i o u").
QString ew::core::LanguageFields::patterns
Space-separated syllable patterns, where C is a consonant slot and V a vowel slot (e.g. "CV CVC V"); any other character is literal.
int ew::core::LanguageFields::minSyllables = 1
The fewest syllables a generated word may have (at least one).
int ew::core::LanguageFields::maxSyllables = 3
The most syllables a generated word may have (at least minSyllables).
QString ew::core::LanguageFields::grammarNotes
Free-form grammar notes for the language (Markdown permitted).
std::vector<LexiconEntry> ew::core::LanguageFields::lexicon
The language's dictionary, in display order.
PhonemeInventory ew::core::LanguageFields::inventory
The structured sound inventory (phonemes + suprasegmentals). Supersedes the flat consonants / vowels strings, which still parse into it on load; empty for a language that has not been given a structured inventory yet.
Phonotactics ew::core::LanguageFields::phonotactics
The structured phonotactics (sound categories, weighted syllable templates, constraints, and rewrite rules) that drive the word generator. Supersedes the flat patterns string, which still parses into it on load; empty for a language that has not been given structured phonotactics yet.
Orthography ew::core::LanguageFields::orthography
The orthography (named romanization schemes over the inventory's default spelling); empty for a language written only in its inventory graphemes.
std::vector<SoundChangeRuleset> ew::core::LanguageFields::soundChanges
The diachronic sound-change rulesets that evolve this language into its daughters/dialects; empty for a language with no recorded sound history.
Grammar ew::core::LanguageFields::grammar
The structured grammar (typology, word order, inflection paradigms, pronouns, number system); supplements the free-form grammarNotes and is empty for a language without one.
WritingSystem ew::core::LanguageFields::writingSystem
The constructed writing system (conscript): glyphs, direction, and ligatures; empty for a language written only in the Latin alphabet.
bool ew::core::LanguageFields::operator==(const LanguageFields &other) const =default
Value equality over all fields, so an edit dialog can detect a no-op change.
LexiconEntry struct
struct ew::core::LexiconEntry
One dictionary entry in a constructed language's lexicon: a headword in the invented language paired with its meaning and optional grammatical detail. This is the unit a worldbuilder accumulates as they flesh a language out – generate or coin a word, then record what it means.
Members
QString ew::core::LexiconEntry::word
The word as written in the constructed language (the headword).
QString ew::core::LexiconEntry::gloss
Its meaning in the writer's own language (the gloss/definition).
QString ew::core::LexiconEntry::partOfSpeech
Optional grammatical category (e.g. "noun", "verb", "adjective"); empty if unclassified.
QString ew::core::LexiconEntry::notes
Optional etymology, usage, or pronunciation notes; empty if none.
QString ew::core::LexiconEntry::id
A stable identifier for this entry, so other entries and cross-references can point at it (for derivation and cognate links). Empty for an entry that has not been assigned one yet.
QString ew::core::LexiconEntry::ipa
The word's pronunciation in IPA; empty when unspecified (the orthography can render it instead).
QString ew::core::LexiconEntry::semanticField
The semantic field or tag this word belongs to (e.g. "kinship", "colour", "weather"), for grouping and generation; empty if unclassified.
QString ew::core::LexiconEntry::inflectionClass
The inflection class / declension or conjugation group this word follows (e.g. "strong verb", "a-stem"); empty if none. Drives which paradigm the grammar applies.
QString ew::core::LexiconEntry::rootId
The id of the entry this word is derived from (a root -> derived link); empty for a root or an unlinked word.
QString ew::core::LexiconEntry::etymology
Free-form etymology or cognate reference (e.g. "< Proto: watar"); empty if none.
bool ew::core::LexiconEntry::operator==(const LexiconEntry &other) const =default
Value equality over all fields, so a lexicon (and thus a LanguageFields) can be compared.