예제 #1
0
  public void addEntry(String entry) {
    String[] values = DictionaryEntryLineParser.parseLine(entry);

    if (values.length == SIMPLE_USERDICT_FIELDS) {
      addSimpleEntry(values);
    } else if (values.length == totalFeatures + 4) { // 4 = surface, left id, right id, word cost
      addFullEntry(values);
    } else {
      throw new RuntimeException("Illegal user dictionary entry " + entry);
    }
  }