コード例 #1
0
 public List<String> getMorphInfo(String s) {
   ArrayList<String> result = new ArrayList<String>();
   int[] ints = decoderEncoder.encodeToArray(revertWord(s));
   int ruleId = findRuleId(ints);
   for (Heuristic h : rules[rulesId[ruleId]]) {
     result.add(
         h.transformWord(s).append("|").append(grammarInfo[h.getFormMorphInfo()]).toString());
   }
   return result;
 }
コード例 #2
0
 public List<String> getNormalForms(String s) {
   ArrayList<String> result = new ArrayList<String>();
   int[] ints = decoderEncoder.encodeToArray(revertWord(s));
   int ruleId = findRuleId(ints);
   boolean notSeenEmptyString = true;
   for (Heuristic h : rules[rulesId[ruleId]]) {
     String e = h.transformWord(s).toString();
     if (e.length() > 0) {
       result.add(e);
     } else if (notSeenEmptyString) {
       result.add(s);
       notSeenEmptyString = false;
     }
   }
   return result;
 }