-
Notifications
You must be signed in to change notification settings - Fork 12
Inflection Patterns
An inflection pattern is a simple string pattern, similar to RegEx (though much more intuitive). Here's a basic guide explaining how to write them.
There are currently four types of patterns. Each type functions a little differently. Let's go over them now.
- Prefix - Matches for this pattern at the start of a word. Written with one hyphen at the start (
-myPattern) - Suffix - Matches for this pattern at the end of a word. Written with one hyphen at the end (
myPattern-) - Whole - Matches for an exact word. Written with no hyphens at either end (
myPattern) - Nonexistent - Relegates matching to another pattern. Written as a single uppercase X (
X)
Should be simple enough to understand; a pattern -a would look for an 'a' at the end of a word, a pattern b- for a 'b' at the start of a word, c would match with a word that's exactly "c".
For Nonexistent, the behavior depends on the current main table. When you hit a Nonexistent pattern, the mod will look for patterns in the same paradigm that best approximate its inflection.
This is useful for adjectives that, let's say, only have singular and plural forms, but are genderless; you could only fill out one gender, then leave everything else Nonexistent, leaving it to the mod to determine which form to use.
Patterns should be written in lowercase, generally. This is because uppercase characters are reserved as 'special characters', with specific meanings. Most of these correspond to diacritics, but some have other functions. Let's go over them now.
Inflection patterns support matching for characters with specific diacritics, and, when a pattern is used to change a word, also apply (or attempt to apply) diacritics to a character.
There are a total of 12 diacritic characters, making them the majority by far. Here's a list of them:
-
G- Grave accent (Àà) -
A- Acute accent (Áá) -
C- Circumflex accent (Ââ) -
T- Tilde (Ãã) -
M- Macron (Āā) -
B- Breve (Ăă) -
D- Diaeresis/Umlaut (Ää) -
R- Ring (Åå) -
K- Caron (Ǎǎ) -
Q- Comma (Șș) -
L- Cedilla (Çç) -
O- Ogonek (Ąą)
There is also N, the negative diacritic character. It matches characters without diacritics, and removes diacritics from characters when used to change a word.
X, when not alone, is used to match for any character. When used to change a word, it leaves the original character at its position without changes. Remember to not use X without any other characters or hyphens, as that refers to a Nonexistent pattern.
- is technically a special character, though we already explained its function at the start of this page.
\ prevents special characters from being treated as special characters, instead being treated as literal characters. Want to match a word with a hyphen somewhere? Put \ before the hyphen to make it literal. This currently does not work with uppercase characters.