Lexurgy SC Cheat Sheet¶
This is a quick reference for the syntax available in Lexurgy SC. Each of these examples is runnable: you should be able to put the contents of the Example column into the Sound Changes box and the input words from the Effect column (to the left of the arrows) into the Input Words box, and get the results shown in the Effect column.
For a gentler introduction, see the Tutorial.
Basics¶
Structure |
Meaning |
Example |
Effect |
---|---|---|---|
Comment |
Ignored by Lexurgy. Use them to remind yourself what a rule is for. |
# This is ignored
|
|
Simple change |
Change sounds to the left of the arrow into sounds to the right of the arrow. |
rule:
a => i
|
bad => bid
banana => binini
|
Condition |
Change sounds only when certain other sounds are nearby. |
rule:
a => i / b _ d
|
bad => bid
bananabad => bananabid
|
Exception |
Change sounds except when certain other sounds are nearby. |
rule:
a => i // b _ d
|
bad => bad
bananabad => bininibad
|
Condition and exception |
You can use conditions and exceptions together to create complex restrictions on changes. |
rule:
a => i / b _ // _ d
|
banana => binana
badaba => badabi
|
Word boundary (start) |
Change sounds only at the beginning of a word. |
rule:
a => i / $ _
|
abanana => ibanana
abada => ibada
|
Word boundary (end) |
Change sounds only at the end of a word. |
rule:
a => i / _ $
|
abanana => abanani
abada => abadi
|
Insertion |
Add sounds between certain other sounds. |
rule:
* => i / b _ d
|
bdana => bidana
ababda => ababida
|
Deletion |
Delete sounds. |
rule:
a => *
|
banina => bnin
badai => bdi
|
Alternatives |
Change each of the sounds on the left into the sound on the right. |
rule:
{b, d} => x
|
banana => xanana
abdab => axxax
|
Alternatives (corresponding) |
Change each of the sounds on the left into the corresponding sound on the right. |
rule:
{b, d} => {x, j}
|
banana => xanana
abdab => axjax
|
Alternative environments |
Apply the change when nearby sounds match any of the conditions. |
rule:
a => i / {b _ d, n _ n}
|
banana => banina
badaba => bidaba
|
Sound class |
Define a list of sounds that tend to behave similarly. |
Class stop {b, d}
rule:
@stop => x
|
banana => xanana
abdab => axxax
|
Sound class (corresponding) |
Change one sound class to another; each sound in the left class turns into the corresponding sound in the right class. |
Class stop {b, d}
Class fricative {v, z}
rule:
@stop => @fricative
|
banana => vanana
abdab => avzav
|
Wildcard |
Matches any single sound. |
rule:
[] => x
|
bad => xxx
bananabad => xxxxxxxxx
|
Digraph |
Define a multi-character symbol that should be treated as one sound. |
Symbol ts, dz
rule:
{t, d} => l
|
badadz => baladz
tsatat => tsalal
|
Escape |
Use a backslash to treat a character as a sound rather than part of the syntax. |
rule:
\* => \@
|
ba*a*a => ba@a@a
|
Combining Elements¶
Structure |
Meaning |
Example |
Effect |
---|---|---|---|
Sequence |
Change several consecutive sounds at once. |
rule:
{b, d} a => * i
|
banana => inana
abdab => abib
|
Optional element |
The rule applies whether the optional element is present or not. |
rule:
a => i / b d? _
|
banana => binana
abdab => abdib
|
Grouping |
Use parentheses to group elements together, so that other syntax applies to the group as a whole. |
rule:
a => i / a (b d)? _
|
aab => aib
abab => abab
abdab => abdib
|
Repeated element (any number) |
Matches any number of copies of the specified element. |
rule:
b => v / _ (an)* a $
|
ba => va
bana => vana
banana => vanana
bananana => vananana
|
Repeated element (one or more) |
Matches one or more copies of the specified element. |
rule:
b => v / _ (an)+ a $
|
ba => ba
bana => vana
banana => vanana
bananana => vananana
|
Repeated element (exact count) |
Matches a specific exact number of copies of the specified element. |
rule:
b => v / _ (an)*2 a $
|
ba => ba
bana => bana
banana => vanana
bananana => bananana
|
Repeated element (range) |
Matches any number of copies of the specified element, within a given range. |
rule:
b => v / _ (an)*(1-2) a $
|
ba => ba
bana => vana
banana => vanana
bananana => bananana
|
Repeated element (upper bound) |
Matches any number of copies of the specified element, up to the given limit. |
rule:
b => v / _ (an)*(-2) a $
|
ba => va
bana => vana
banana => vanana
bananana => bananana
|
Repeated element (lower bound) |
Matches at least this many copies of the specified element. |
rule:
b => v / _ (an)*(2-) a $
|
ba => ba
bana => bana
banana => vanana
bananana => vananana
|
Capture |
Remember the sounds that an element matched and refer to them later. |
rule:
{b, d}$1 => * / _ $1
|
abbanna => abanna
abdadda => abdada
|
Negation |
Matches anything but the specified element. |
rule:
!a => x
|
banana => xaxaxa
abdab => axxax
|
Intersection |
Sounds must match both criteria at the same time. |
Class stop {t, d, k, g}
Class alveolar {t, d, s, z}
rule:
@stop&@alveolar => r / a _ a
|
bataka => baraka
tasada => tasara
|
Negated Intersection |
Sounds must match the first element but not the second element. |
Class stop {t, d, k, g}
Class alveolar {t, d, s, z}
rule:
@stop&!@alveolar => r / a _ a
|
bataka => batara
tagasa => tarasa
|
Dummy rule |
Does nothing. Use this if you need a rule for other reasons but don’t want it to change anything. |
rule:
unchanged
|
banana => banana
abdab => abdab
|
Multiple words |
Spaces between words are
treated as boundaries:
|
rule:
t => * / _ $
t => s / _ a
|
ratatat => rasasa
rat atat => ra asa
|
Between words |
Matches the space between words |
rule:
$$ => * / _ a
t => d / n $$ _
|
rat atat => ratatat
ran tanta => ran danta
|
Reusable element |
Define a complex element that can be referenced by name |
Element batman (na)+
rule:
a => i / _ @batman b
b => v / $ @batman _
|
bananabad => bininabad
nananab => nininav
|
Features¶
The examples in this section all require the following declarations:
Feature low, high, front, back
Feature voicing(unvoiced, voiced)
Feature place(labial, alveolar, velar)
Feature manner(stop, fricative, nasal)
Symbol a [+low -high -front -back]
Symbol e [-low -high +front -back]
Symbol i [-low +high +front -back]
Symbol o [-low -high -front +back]
Symbol u [-low +high -front +back]
Symbol p [unvoiced labial stop]
Symbol b [voiced labial stop]
Symbol t [unvoiced alveolar stop]
Symbol d [voiced alveolar stop]
Symbol k [unvoiced velar stop]
Symbol g [voiced velar stop]
Symbol f [unvoiced labial fricative]
Symbol v [voiced labial fricative]
Symbol s [unvoiced alveolar fricative]
Symbol z [voiced alveolar fricative]
Symbol m [labial nasal]
Symbol n [alveolar nasal]
Then put any additional declarations in the appropriate sections. Remember that all the feature declarations must come first, then all the symbol and diacritic declarations, then the rules.
Structure |
Meaning |
Example |
Effect |
---|---|---|---|
Binary feature |
These features can either
be plus ( |
rule:
[-low -high] => [+high] / _ $
|
benene => beneni
bonono => bononu
|
Multivalent feature |
These features can have multiple values, each with a distinct name. |
rule:
[labial] => [alveolar]
|
bememe => denene
pofofo => tososo
|
Absent value |
If a feature isn’t
mentioned in a symbol
declaration, it’s
automatically absent
( |
rule:
[*place] => i
|
benene => binini
dofofo => dififi
|
Univalent feature |
These features are minus by default. |
Feature +lateral
Symbol l [alveolar +lateral]
rule:
[alveolar -lateral] => x
|
benene => bexexe
dololo => xololo
|
Feature variable |
Copy a feature value from one sound to another. |
rule:
[stop] => [$voicing] / _ [stop $voicing]
|
abtadka => aptatka
akdak => agdak
|
Negated value |
Match only sounds that don’t have a specific feature value. |
rule:
[!labial] => i
|
benene => biiiii
dofofo => iififi
|
Diacritic |
Add features to a sound by putting a modifier character after it. |
Feature +ejective
Diacritic ' [+ejective]
rule:
[unvoiced stop]$1 $1 => [+ejective] *
|
appakka => ap'ak'a
attakta => at'akta
|
Diacritic (before) |
This diacritic is written before the sound it modifies. |
Feature +ejective
Diacritic ' (before) [+ejective]
rule:
[unvoiced stop]$1 $1 => [+ejective] *
|
appakka => a'pa'ka
attakta => a'takta
|
Diacritic (first) |
This diacritic is written after the first character of the sound it modifies. |
Feature +hightone
Diacritic ' (first) [+hightone]
Symbol ai [+low +high +front -back]
rule:
[+low] => [+hightone] / [unvoiced stop] _
|
pataida => pa'ta'ida
badaita => badaita'
|
Floating diacritic |
Sounds and classes without the diacritic match sounds with it. |
Feature +hightone
Diacritic ' (floating) [+hightone]
rule:
{u, e} => {o, i}
|
be'ne'ne' => bi'ni'ni'
bununu => bonono
|
Exact match |
This sound must match exactly, including floating diacritics. |
Feature +hightone
Diacritic ' (floating) [+hightone]
rule:
{u!, e!} => {o, i}
|
be'ne'ne' => be'ne'ne'
bununu => bonono
|
Inexact capture |
Match a captured sound, even if it has different floating diacritics |
Feature +hightone
Diacritic ' (floating) [+hightone]
rule:
{u, e}$1 => {o, i} / ~$1 _
|
be'eneu' => be'ineu'
buunu'e' => buonu'e'
|
Named absent value |
Use the specified name
to refer to the absent
value instead of the
|
Feature tone(*lowtone, hightone)
Diacritic ' [hightone]
rule:
[-low -high lowtone] => [+high]
|
bene'ne => bine'ni
bo'nono' => bo'nuno'
|
Blocks¶
Structure |
Meaning |
Example |
Effect |
---|---|---|---|
Simultaneous expression |
Apply several changes, finding all possible application sites simultaneously. |
rule:
a => i / b _ d
b => v / _ a
|
bad => vid
banana => vanana
bananabad => vananavid
|
Simultaneous expression (precedence) |
Earlier expressions take precedence over later ones if they conflict. |
rule:
a => i / b _ d
a => u
|
bad => bid
banana => bununu
bananabad => bununubid
|
Sequential block |
Apply several changes, one after the other. |
rule:
a => i / b _ d
Then: b => v / _ a
|
bad => bid
banana => vanana
bananabad => vananabid
|
Hierarchical block |
Apply later expressions only if earlier ones fail to change anything. |
rule:
a => i / b _ d
Else: b => v / _ a
|
bad => bid
banana => vanana
bananabad => bananabid
|
Propagating rule |
Apply the rule repeatedly until the word stops changing. |
rule propagate:
dd => xx
{cx, xc} => xx
{bx, xb} => xx
|
abcddcba => axxxxxxa
|
Left-to-right rule |
Apply the rule once starting at each character, from the beginning of the word to the end. |
rule ltr:
dd => xx
{cx, xc} => xx
{bx, xb} => xx
|
abcddcba => abcxxxxa
|
Right-to-left rule |
Apply the rule once starting at each character, from the end of the word to the beginning. |
rule ltr:
dd => xx
{cx, xc} => xx
{bx, xb} => xx
|
abcddcba => axxxxcba
|
Filter |
The rule pretends that only sounds that match the filter exist. Adjacency passes through non-matching sounds. |
Class vowel {a, e, i}
rule @vowel:
a => e / _ i
|
aitati => eiteti
annanni => annenni
|
Deferred rule |
The rule doesn’t apply when declared, but can be applied later as part of other rules |
x defer:
{dd, bx, xb} => xx
rule:
:x
Then:
{cx, xc} => xx
Then:
:x
|
abcddcba => axxxxxxa
|
Cleanup rule |
The rule applies once when declared, then again after every subsequent rule |
x cleanup:
{dd, bx, xb} => xx
rule:
{cx, xc} => xx
|
abcddcba => axxxxxxa
|
Cleanup off |
Turn off an active cleanup rule for subsequent rules |
x cleanup:
{dd, bx, xb} => xx
x:
off
rule:
{cx, xc} => xx
|
abcddcba => abxxxxba
|
Deromanizer |
Convert the romanization system into phonetic notation before applying any rules. |
deromanizer:
kh => x
|
khakhi => xaxi
|
Literal deromanizer |
Ignore all declarations
until the first
|
Feature +ejective
Diacritic ' [+ejective]
deromanizer literal:
' => h
rule:
k => k'
|
'a'i => hahi
kaki => k'ak'i
k'ak'i => k'hak'hi
|
Romanizer |
Convert phonetic notation into the romanization system after applying all the rules. |
romanizer:
x => kh
|
xaxi => khakhi
|
Literal romanizer |
Ignore all declarations
after the last
|
Feature +ejective
Diacritic ' [+ejective]
rule:
k' => k
romanizer literal:
h => '
|
hahi => 'a'i
k'ak'i => kaki
khakhi => k'ak'i
|
Intermediate romanizer |
Preserve an intermediate stage of the language. |
rule-1:
a => i
romanizer-a:
unchanged
rule-2:
i => u
|
hahi => hihi => huhu
|
Syllables¶
Structure |
Meaning |
Example |
Effect |
---|---|---|---|
Explicit syllables |
Syllable breaks ( |
Syllables:
explicit
rule:
a => i / _ n
|
banana => binina
ba.na.na => bi.ni.na
|
Syllable boundary |
Matches syllable breaks and word boundaries. |
Syllables:
explicit
rule:
a => i / _ .
|
banana => banani
ba.na.na => bi.ni.ni
ban.ta => ban.ti
|
Syllable element |
Matches an entire syllable. |
Syllables:
explicit
rule:
<syl> => x
|
banana => x
ba.na.na => x.x.x
|
Syllabification |
Automatically break words into syllables matching specified patterns. |
Syllables:
{b, n} a
|
banana => ba.na.na
banina => #Error!
|
Resyllabification |
Words are automatically broken into syllables again at the end of each named rule. |
Syllables:
{b, n} a
rule:
a => aba / n _ n
|
banana => ba.na.ba.na
|
New syllabification |
Change syllabification patterns between rules. |
Syllables:
{b, n} a
rule:
a => i / _ n
Syllables:
{b, n} {a, i}
|
banana => bi.ni.na
|
Clearing syllables |
Throw away all syllable information for subsequent rules. |
Syllables:
explicit
rule:
a => i / _ n
Syllables:
clear
|
ba.na.na => binina
|
Syllable-level features |
These features attach to whole syllables rather than sounds. |
Feature (syllable) +stress
Diacritic ' (before) [+stress]
Syllables:
explicit
rule:
a&[+stress] => e
|
'ba.na.na => 'be.na.na
ba.'na.na => ba.'ne.na
|
Syllabification features |
Apply syllable-level features to syllables that match certain patterns |
Feature (syllable) +stress
Diacritic ' (before) [+stress]
Syllables:
b a => [+stress]
n a
|
banana => 'ba.na.na
nabana => na.'ba.na
|