Vulgar: Language generator

The Phonological Rules section allows both phonological rule notation and RegEx notation, which are quite different from each other.

The standard phonological rule notation was invented by linguists to describe sound changes. It is the notation that looks like m > n / _i, where > means “changes to”, the forward slash means “in the environment of” and the underscore denotes where the m would be, thus: m changes to n before any i. One big advantage of this system is the syntax for doing “in the environment of” is much simpler than in RegEx.

RegEx, on the other hand, was invented by computer programmers for general pattern finding in text. Although it has nothing to do with linguistics, it is naturally more logical and better bug tested. For this reason, RegEx is the only option for Spelling rules and Illegal combination rules. See full guide to RegEx here.

Use whichever notation you are most comfortable with. If you phonological rule contains both the “/” and “_” symbols, it will treat it as the phonological rule notation. Otherwise it will treat it as RegEx. Also note that Spelling rules and Illegal combinations only allow RegEx.

Process Phonological rule notation RegEx
m changes to n in all environments* m > n m > n
m changes to n at the beginning of a word m > n / #_ ^m > n
m changes to n at the end of a word m > n / _# m$ > n
m changes to n before e m > n / _e m(?=e) > n
m changes to n after e m > n / e_ (?<=e)m > n
m or ŋ changes to n before e {m,ŋ} > n / _e [mŋ](?=e) > n
all consonants change to n before e C > n / _e [bdfghjklmnŋpɹstvwzʃʒʧʤθð](?=e) > n
all consonants change to stops before e C > [+stop] / _e Requires individual rules for each consonant
m changes to n before any vowel m > n / _V m(?=[aeiou]) > n
delete m before e m > Ø / _e m(?=e) >
m, optionally followed by s, changes to n before e m(s) > n / _e m(s)?(?=e) > n
m changes to n before syllable boundary m > n / _% Requires a custom definition of what the syllable boundary is

* This kind of change doesn’t make sense as a “phonological change”. If all m’s change to n’s in your language, then your language simply does not have the phoneme m. It might make sense to do this as spelling change, but not a phonological change.

Other shorthand symbols

These shorthand symbols work in phonological rules, and anywhere RegEx can be used. However, be aware they are NOT a part of standard RegEx, and some bugs may arise using them in more complex rules.

Shorthand code Category
A or C[+affricate] Affricates
B or V[+back] Back vowels
C Consonants
C[+voice] Voiced consonants
C[-voice] Voiceless consonant
C[+alveolar] Alveolar consonants
C[+alveolo-palatal] Alveolo-palatal consonants
C[+bilabial] Bilabial consonants
C[+dental] Dental consonants
C[+flap] Flap/tap consonants
C[+glottal] Glottal consonants
C[+labiodental] Labiodental consonants
C[+post-alveolar] Post-alveolar consonants
C[+retroflex] Retroflex consonants
C[+palatal] Palatal consonants
C[+pharyngeal] Pharyngeal consonants
C[+trill] Trill consonants
E or V[+front] Front vowels
F or C[+fricative] Fricatives
H or C[+laryngeal] Laryngeals
K or C[+velar] Velars
L or C[+liquid] Liquids
M Diphthongs
N or C[+nasal] Nasal consonants
P or C[+labial] Labials
Q or C[+uvular] Uvulars
S or C[+stop] Stops
V Vowels, including diphthongs
V[+high] High vowels
V[+low] Low vowels
V[+round] Rounded vowels
V[-round] Unrounded vowels
W Semivowels

Note: In the “changes to” section (between > and / symbols), the uppercase letter is redundant, thus both C[+stop] > [+nasal] / _# and C[+stop] > C[+nasal] / _# are valid rules.