Lexurgy Sound Changer How To
Stress Assignment
Stress is usually best expressed as a syllable-level feature with a "before" diacritic. Then you can use an ordinary rule to assign stress:
In this case, the stress rule is simple—always stress the last syllable—so the stress assignment rule is also simple.
For more complex stress rules, one approach is:
- Use syllable-level feature assignment to assign temporary weight features to each syllable.
- Use hierarchical blocks to assign stress based on the weight features.
- Remove the weight features and reset the syllable structure.
Suppose that you want a word to be stressed on the last long vowel if one exists; otherwise on the last closed syllable if one exists; otherwise on the last syllable. You can write this as follows:
Breaking the Rules
Lexurgy is meant for simulating how natural languages evolve, so its features are tailored to that use case. But Lexurgy is also Turing complete; with the right rules, it can perform arbitrary computations. Even if your sound changes are highly unusual, Lexurgy can represent them.
Suppose that you want to change all instances of a
into e
, but only in words with an odd number of phonemes. This is probably impossible in human languages, but maybe it makes sense for your project. Lexurgy has no built-in way to count the number of phonemes in a word, but you can still write a rule that does this:
This works as follows:
- Add a temporary diacritic
^
to the first sound in the word. - Scanning from left to right, add a
^
two sounds to the right of each existing^
. This puts a^
on every second sound, starting with the first. - Remove all
^
except on the last segment of the word. Since^
occurs only on sounds in an odd position, it can only occur on the last sound if the word has an odd number of sounds. - Change
a
toe
only in words that have a^
in them. - Remove all
^
diacritics.
Make sure to use "Trace Changes" if you find this confusing. This rule removes all the temporary diacritics to cover its tracks, but "Trace Changes" reveals exactly what they're doing.
As this example shows, the key is usually to add temporary symbols (often diacritics) and use Lexurgy's iterative constructs (propagate
, ltr
, and rtl
).
Just to show how powerful this can be, here are some Lexurgy rules that perform addition:
Again, use "Trace Changes" if you find this confusing.