The Mongolian language has "vowel harmony". In short the vowel harmony means that certain vowels are not allowed to be placed next to each other in a word. This means that suffixes of words have to care about the vowels present in the words they attach to and need to resolve to a vowel that matches the harmony of the word.
Mongolian harmony compares about 3 binary properties that vowels can have.
- A vowel can be round
- A vowel can be high
- A vowel can be ATR (advanced tongue root)
If a vowel has a property, we indicate that with a
+ and square brackets if it does not we indicate that with a
- and square brackets. e.g. [-ATR] indicates that the vowel does not have the ATR property.
There are thus 8 combinations of these properties that can be made. Mongolian has exactly 1 vowel for each combination except [+high][-ATR][-round] which is missing a vowel.
The 7 vowels and their values can be given in the table below:
This table gives both the XSAMPA (code block) and IPA (parentheses) values for each vowel, but we will care about the XSAMPA values for this challenge.
Every word in Mongolian is either [+ATR] or [-ATR] with only vowels of the corresponding [ATR] value appearing in that word. The once exception is
i which is "transparent" for [ATR] harmony. Meaning it acts as if it is in both categories even though it is [+ATR]. Meaning that
i can appear in words with any vowels.
This can be illustrated with the following Venn diagram:
Modified with permission from Mongolian vowel harmony Venn diagram by wikimedia commons user AquitaneHungerForce. Liscensed under the Creative Commons Attribution-Share Alike 4.0 International license. See link for full attribution.
Mongolian also has [round] harmony which only affects [-high] vowels. At its simplest under [round] harmony if a [-high] vowel is the next vowel after a [-high] vowel, it must have the same [round] value.
i is also transparent for roundness harmony so we skip over
i when looking for the last vowel.
Given a sequence of Mongolian vowels determine if they follow the rules of vowel harmony. Input can be either a list of XSAMPA vowels, or a string of XSAMPA vowels. Input will always be non-empty.
You should output one of two distinct values, the first if it is a valid sequence the second if it is not.
This is code-golf so your goal is to minimize the size of your source code as measured in bytes.
iiiiiii oi Oi ui Ui ei ai UO oiou uie ouie OUia
uU oO eia oiie OUie eieio
This post is based off of the description from:
- Godfrey, Ross (2012). "Opaque Intervention in Khalkha Mongolian Vowel Harmony: A Contrastive Account" pdf.