SoundChangeRule.h header

#include <ew/core/SoundChangeRule.h>

Namespace ew::core

SoundChangeRule struct

struct ew::core::SoundChangeRule

One diachronic sound-change rule in the SCA² tradition, written target -> replacement / environment. It rewrites every occurrence of target (a sequence of graphemes and/or phonotactics category symbols) into replacement (a sequence of graphemes, empty to delete the sound) wherever the surrounding context matches environment. The environment is a context string with _ marking where the target sits, # a word boundary, and category symbols or literal graphemes on either side (e.g. V_V for "between vowels", _# for "word-finally"); an empty environment means the change applies everywhere. This is the unit a language family is built from: apply an ordered list of these to a word to see how it evolves.

Members

QString ew::core::SoundChangeRule::target

The sound(s) that change: a sequence of literal graphemes and/or single-character category symbols (e.g. "p", "C", "sh"). An empty target makes the rule a no-op.

QString ew::core::SoundChangeRule::replacement

What the target becomes: a sequence of literal graphemes, or empty to delete the target.

QString ew::core::SoundChangeRule::environment

The context in which the change applies, with _ for the target slot, # for a word boundary, and category symbols or literal graphemes around it (e.g. "V_V"). Empty applies everywhere.

bool ew::core::SoundChangeRule::operator==(const SoundChangeRule &other) const =default

Value equality over all fields.

SoundChangeRuleset struct

struct ew::core::SoundChangeRuleset

A named, ordered list of SoundChangeRule that together evolve a language: applying the ruleset to a word runs each rule in turn on the output of the previous one. A proto-language can carry several rulesets – one per daughter language or dialect – so an entire family descends from a single source by different rule sequences.

Members

QString ew::core::SoundChangeRuleset::name

The ruleset's display name (e.g. "Proto -> Coastal dialect").

std::vector<SoundChangeRule> ew::core::SoundChangeRuleset::rules

The rules, applied in order (each to the output of the previous).

bool ew::core::SoundChangeRuleset::operator==(const SoundChangeRuleset &other) const =default

Value equality over all fields.