Sound change rules (also known as phonological rules) are mainly used in the Sound Change field and in custom affixes. This notation can also be used in the Custom Spelling field to mimic spelling idiosyncrasies of natural languages, and in illegal combinations field to prohibit combinations of phonemes.

A basic rule like a > e changes every a to e. Try it yourself:

InputRuleOutput

You can also specify if the change should only happen in a particular environment: a > e / _b changes every a to e if it comes before a b. The / means "in the environment of" and _ signifies where the a is.

InputRuleOutput

Word boundary

# signifies a word boundary. Notice how the following pattern only changes the first a.

InputRuleOutput

Multiple symbols

You can capture multiple symbols inside curly brackets, eg {b,m}:

InputRuleOutput

Shorthand symbols

Vulgar uses various shorthand abbreviations for classes of phonemes, such as C for "any consonant" or V for "any vowel":

InputRuleOutput

Here is a complete list:

SymbolMeaning
AAffricate
BBack vowel
CConsonant
DAny IPA letter (does not match diacritics)
ᴰ (superscript D)Any diacritic symbol
EFront vowel
FFricative
HLaryngeal
KVelar
LLiquid
MDiphthong / Triphthong
NNasal consonant
OObstruent
PLabial
QUvular
RSonorant/resonant
SStop
U or σSyllable
%Syllable boundary (includes beginning and end of word)
VVowel (including diphthongs)
WSemivowel
XAny phoneme
ZContinuant

Quantifiers

A question mark ? makes anything before it optional:

InputRuleOutput

Use round brackets to capture a longer pattern:

InputRuleOutput
Note: Vulgar Sound Change Notation (VSCN) is ever-so slightly different to the notation typically used in linguistics literature, which makes anything in brackets "optional". Whereas VSCN requires a question mark, because round brackets are used for backreferencing (see below). Problematically, the notation used in linguistic literature has never been universally standardised, and has no robust way of doing backreferences. Therefore, we propose VSCN as a universal standard (if anyone will listen)!

Plus symbol + means one or more of whatever is before it:

InputRuleOutput

Star symbol * means zero or more of whatever is before it:

InputRuleOutput

Backreferences

Numbers refer back to whatever was captured inside brackets. The number 1 refers to whatever was matched in the first brackets. The following pattern matches a vowel at the end of the word, and doubles it:

InputRuleOutput

The following pattern matches two consonants in a row and swaps them:

InputRuleOutput

Zero refers to the entire match:

InputRuleOutput

Null symbol

Note: Ø signifies nothing (not to be confused with zero!).

InputRuleOutput
Note: IPA officially uses the ∅ character (U+2205), however Vulgar uses Ø (U+00D8) because it has more font support.

Exceptions to rules

The ! symbol signifies an exception to a rule: m > n / !_e changes m to n except before e. Similarly, m > n / !e_ changes m to n except after e (this may not work in older browsers).

Exception rules can also be added to the end of a normal rule, eg: m > n / _e !s_ means m changes n before e, except after s.

Reduplication

The dot symbol . matches any character. You can combine some rules we have already learned to reduplicate an entire match:

InputRuleOutput

Dealing with stress symbols

If you want to make spelling rules that are sensitive to stress, you first need to check the Make spelling rules sensitive to stress symbol option. (The default setting is to apply the spelling rules with the stress symbol already removed, so that you don't have to worry about the stress symbol making your patterns more complicated.) Let's say you want stressed a to turn into á, like in Spanish spelling. The stress symbol could come right before an a, as in ˈama, however it could also come before any number of consonants and then an a, as in ˈdrama. To capture zero or more consonants you need to write C*. And don't forget about the stress symbol!.

InputRuleOutput

Finally, you will need a second rule to replace stress symbols with nothing.

Non-Latin alphabets

Custom spelling supports all Unicode alphabets and scripts, such as Japanese, Chinese, Cyrillic, Georgian and even Unicode Emojis.

Order of rules

The order of your custom spelling rules matter. Vulgar will find-and-replace the first spelling rule to a word, then apply the next rule over the top of what it just did. This can be a problem if a IPA symbol appears in multiple patterns. For instance, the following rules are problematic:

ʊ > u
aʊ > ow

The intent here is for the diphthong (as in the word "cow") to change to ow. However, a previous rule has already changed any ʊ (as in the word "put") to u, which means has already changed to au. The easiest solution is to reverse the order of the rules:

aʊ > ow
ʊ > u

Another solution is to use the ! symbol to add an "except when" condition: ʊ > u / !a_.