Creating a method that decides the vowel harmony of a word

vowel harmony example
vowel harmony in english
vowel harmony in bengali
consonant harmony
ipa chart
    public static String vowelHarmony(String input) {

    String[] high = {"e", "i"};
    String[] deep = {"a", "o", "u"};

    for (int i = 0; i < input.length(); i++) {
        if (input.contains(high[i])&&!input.contains(deep[i])){
            return "high";
        else if (input.contains(deep[i])&&!input.contains(high[i])){
            return "deep";
        else if (input.contains(deep[i])&&input.contains(high[i])){
            return "mixed";
    return "you screwed something up";

I know, I know, vowel harmony doesn't exist in English but for the sake of the example let's pretend that it does. The high vowels are 'e' and 'i'. The deep vowels are 'a', 'o', and 'u'. All words belong to either the group high, deep or mixed.

For example:

  • If a word only has high vowels, it is a high word (hell, hill, mill, kill, etc.)
  • If a word only has deep vowels, it is a deep word (sword, hold, stool, cool, etc.)
  • If a word has vowels from both groups, it is a mixed word (mule, mountain, house, choose etc.)

The only thing is, my code doesn't work as it's supposed to. It never displays if a word is mixed. If a word even has a single high letter in it, it will be displayed as high. What do I need to do to fix it? What's wrong with my code?

[PDF] Vowel Harmony, 5 Unsupervised Methods for Quantifying and Diagnosing Vowel Harmony. Now I decide that it's time to create a new word in my constructed language. Having  The term vowel harmony is used in two different senses. In the first sense, it refers to any type of long distance assimilatory process of vowels, either progressive or regressive. When used in this sense, the term vowel harmony is synonymous with the term metaphony . In the second sense,

You can do it easily:

    enum Harmony {
        Deep, High, Mixed, Nothing

    public static Harmony vowelHarmony(String input) {
        boolean canBeHigh = false, canBeDeep = false;
        if (input.contains("a") || input.contains("o") || input.contains("u"))
            canBeDeep = true;
        if (input.contains("e") || input.contains("i"))
            canBeHigh = true;
        if (canBeDeep && canBeHigh)
            return Harmony.Mixed;
        if (canBeDeep)
            return Harmony.Deep;
        if (canBeHigh)
            return Harmony.High;
        return Harmony.Nothing;

Natural Language Processing with Python: Analyzing Text with the , Each word of the text is converted as follows: move any consonant (or harmony (e.g., Hungarian), extract the vowel sequences of words, and create a Python's random module includes a function choice() which randomly chooses an item  Altaic languages. In Altaic languages: Phonology …of sound harmony affecting the vowels and velar stops. In palatal vowel harmony, all the vowels of a given word are back or they are all front; further, front velar consonants /k g/ occur only with front vowels and back (deep) velars /q g/ only with back vowels.

Hi I have done a bit of Jugaad just to make life easy.I know its not a good coding practice though

    enum Harmony
   public static Harmony vowelHarmony(String input) 

        String[] high = {"e", "i"};
        String[] deep = {"a", "o", "u"};
        input=input.replaceAll("[ei]", "1");
        input=input.replaceAll("[aou]", "0");
        input=input.replaceAll("[^01]", "");
        if(input.contains("1") && !input.contains("0"))
            return Harmony.High;
        else if(input.contains("1") && !input.contains("0"))
            return Harmony.Low;
        else if(input.contains("1") && !input.contains("0"))
            return Harmony.Mixed;
            return Harmony.Screwed;

Canonical Morphology and Syntax, Thus, with the front vowel word menet 'you go' we have menet1⁄4kö 'Are you going? from clitics in that they readily create words which violate vowel harmony. Vowel harmony is a phenomenon in some languages whereby all vowels in a word must be members of the same subclass. A language typically has two subclasses of vowels based on some kind of feature, for example: the language's vowels could be divided into high and low vowels; if a word begins with a high vowel all other vowels must be high vowels.

Dynamics and Transparency in Vowel Harmony, In most common cases, harmony applies within words, i.e. both stems and and disadvantages of defining the harmony domain in prosodic or morphological feature, vowel harmony has a similar function as stress in delimiting a word  1. Asymmetries in Vowel Harmony 1.1 General Properties of Vowel Harmony Vowel harmony is a widespread phenomenon in the languages of the world, even though it may be unfamiliar to speakers of many widely used languages such as English, Chinese, or Spanish. In the most general sense, VH occurs when there is a requirement in a given

Prosodic Studies: Challenges and Prospects, Powerful interword vowel harmony? (1934), who reports only some familiar clitic-like extensions to monosyllabic function words. extending to all vowels in the word, but weak between words, rarely making it out of the word and​,  A common theme of harmonic systems is that affixes will contain a sound underspecified for category, which will appear as the corresponding sound in whatever category the rest of the word follows (like how the plural suffix -l(vowel)r contains a high unround vowel whose harmonic frontness category is determined by earlier vowels).

[PDF] Harmony Systems, be involved in the assimilation, as shown for vowel-consonant harmony in (1b). The rightmost sibilant determines the tongue When emphasis harmony affects all segments in a word, it is sometimes difficult harmony as opposed to creating an independent span. e.g. [usulj-y] 'method' acc *usulj-u (Levi 2001). The Turkish language’s system of vowel harmony consists of two different types: major vowel harmony and minor vowel harmony. Every source use different terms to refer Turkish vowel harmony rules. You may see people calling major and minor, but you can also see 4-way and 2-way, lastly i-type and a-type.

  • Once any of your return statements are hit, the method ends. For example, if hello was your word, it would check for e and not a (the first position on each array), which are both true, therefore it will return high and not search again. Also, searching using the length of the input over two different length arrays probably isn’t ideal.
  • Thank you, this is my favorite solution and the most readable. I have no idea how didn't making other methods to check for different types of vowels didn't occur to me.
  • Three booleans with multi-level conditionals attached to each of them. It's not exactly that straightforward to read.
  • This doesn't handle cases of input with no vowels. Why would you use && and then negate each term? isHigh = input.contains("e") || input.contains("i"); makes much more sense to me.
  • I changed it for better doesn't handle the case which is not both of them (not deep and not high). thanks for mention.
  • You're still using && instead of || but bonus points for using an enum instead of string. We're talking about Java, not Perl after all. No need for stringly typed values.
  • Thanks. I fixed it too. I use Enum only for better representation and clarity.