Esempio n. 1
0
 /**
  * If the given string ends with a consonant, insert a syllable boundary before that consonant.
  * Otherwise, append a syllable boundary.
  *
  * @param s input syllable
  * @return syllable with boundaries reset
  */
 private String rebuildTrans(String s) {
   AllophoneSet set = jphon.getAllophoneSet();
   if (set != null) {
     Allophone[] allophones = set.splitIntoAllophones(s);
     if (allophones != null && allophones.length > 0) {
       Allophone last = allophones[allophones.length - 1];
       if (last.isConsonant()) { // insert a syllable boundary before final consonant
         String lastPh = last.name();
         return s.substring(0, s.length() - lastPh.length()) + "-" + lastPh;
       }
     }
   }
   return s + "-";
 }