*/
public void processUtterance(Utterance utterance) throws ProcessException {
String silence = utterance.getVoice().getFeatures().
getString(Voice.FEATURE_SILENCE);
Item phraseHead = utterance.getRelation(Relation.PHRASE).getHead();
// If there are not any phrases at all, then just skip
// the whole thing.
if (phraseHead == null) {
return;
}
// insert initial silence
Relation segment = utterance.getRelation(Relation.SEGMENT);
Item s = segment.getHead();
if (s == null) {
s = segment.appendItem(null);
} else {
s = s.prependItem(null);
}
s.getFeatures().setString("name", silence);
for (Item phrase = phraseHead;
phrase != null;
phrase = phrase.getNext()) {
Item word = phrase.getLastDaughter();
while (word != null) {
Item seg = segmentPath.findItem(word);
// was this an explicit change or a lost bug fix
//if (seg != null && !"".equals(puncPath.findFeature(word))) {
if (seg != null) {
Item pause = seg.appendItem(null);
pause.getFeatures().setString("name", silence);
break;
}
word = word.getPrevious();
}
}