private static CharArrayMap<DictEntry> initializeDictHash() {
    DictEntry defaultEntry;
    DictEntry entry;

    CharArrayMap<DictEntry> d = new CharArrayMap<>(1000, false);
    for (int i = 0; i < exceptionWords.length; i++) {
      if (!d.containsKey(exceptionWords[i])) {
        entry = new DictEntry(exceptionWords[i], true);
        d.put(exceptionWords[i], entry);
      } else {
        throw new RuntimeException("Warning: Entry [" + exceptionWords[i]
            + "] already in dictionary 1");
      }
    }
    
    for (int i = 0; i < directConflations.length; i++) {
      if (!d.containsKey(directConflations[i][0])) {
        entry = new DictEntry(directConflations[i][1], false);
        d.put(directConflations[i][0], entry);
      } else {
        throw new RuntimeException("Warning: Entry [" + directConflations[i][0]
            + "] already in dictionary 2");
      }
    }
    
    for (int i = 0; i < countryNationality.length; i++) {
      if (!d.containsKey(countryNationality[i][0])) {
        entry = new DictEntry(countryNationality[i][1], false);
        d.put(countryNationality[i][0], entry);
      } else {
        throw new RuntimeException("Warning: Entry [" + countryNationality[i][0]
            + "] already in dictionary 3");
      }
    }
    
    defaultEntry = new DictEntry(null, false);
    
    String[] array;
    array = KStemData1.data;
    
    for (int i = 0; i < array.length; i++) {
      if (!d.containsKey(array[i])) {
        d.put(array[i], defaultEntry);
      } else {
        throw new RuntimeException("Warning: Entry [" + array[i]
            + "] already in dictionary 4");
      }
    }
    
    array = KStemData2.data;
    for (int i = 0; i < array.length; i++) {
      if (!d.containsKey(array[i])) {
        d.put(array[i], defaultEntry);
      } else {
        throw new RuntimeException("Warning: Entry [" + array[i]
            + "] already in dictionary 4");
      }
    }
    
    array = KStemData3.data;
    for (int i = 0; i < array.length; i++) {
      if (!d.containsKey(array[i])) {
        d.put(array[i], defaultEntry);
      } else {
        throw new RuntimeException("Warning: Entry [" + array[i]
            + "] already in dictionary 4");
      }
    }
    
    array = KStemData4.data;
    for (int i = 0; i < array.length; i++) {
      if (!d.containsKey(array[i])) {
        d.put(array[i], defaultEntry);
      } else {
        throw new RuntimeException("Warning: Entry [" + array[i]
            + "] already in dictionary 4");
      }
    }
    
    array = KStemData5.data;
    for (int i = 0; i < array.length; i++) {
      if (!d.containsKey(array[i])) {
        d.put(array[i], defaultEntry);
      } else {
        throw new RuntimeException("Warning: Entry [" + array[i]
            + "] already in dictionary 4");
      }
    }
    
    array = KStemData6.data;
    for (int i = 0; i < array.length; i++) {
      if (!d.containsKey(array[i])) {
        d.put(array[i], defaultEntry);
      } else {
        throw new RuntimeException("Warning: Entry [" + array[i]
            + "] already in dictionary 4");
      }
    }
    
    array = KStemData7.data;
    for (int i = 0; i < array.length; i++) {
      if (!d.containsKey(array[i])) {
        d.put(array[i], defaultEntry);
      } else {
        throw new RuntimeException("Warning: Entry [" + array[i]
            + "] already in dictionary 4");
      }
    }
    
    for (int i = 0; i < KStemData8.data.length; i++) {
      if (!d.containsKey(KStemData8.data[i])) {
        d.put(KStemData8.data[i], defaultEntry);
      } else {
        throw new RuntimeException("Warning: Entry [" + KStemData8.data[i]
            + "] already in dictionary 4");
      }
    }
    
    for (int i = 0; i < supplementDict.length; i++) {
      if (!d.containsKey(supplementDict[i])) {
        d.put(supplementDict[i], defaultEntry);
      } else {
        throw new RuntimeException("Warning: Entry [" + supplementDict[i]
            + "] already in dictionary 5");
      }
    }
    
    for (int i = 0; i < properNouns.length; i++) {
      if (!d.containsKey(properNouns[i])) {
        d.put(properNouns[i], defaultEntry);
      } else {
        throw new RuntimeException("Warning: Entry [" + properNouns[i]
            + "] already in dictionary 6");
      }
    }
    
    return d;
  }
A stemmer implementing the Kstem algorithm by Bob Krovetz.
linguistics/src/main/java/com/yahoo/language/simple/kstem/KStemmer.java