/** * Because the growBranches() is called although no data is left after the * last speech frame, the ordering of the active-list might depend on the * transition probabilities and (penalty-scores) only. Therefore we need to * undo the last grow-step up to final states or the last emitting state in * order to fix the list. * * @return newly created list */ protected ActiveList undoLastGrowStep() { ActiveList fixedList = activeList.newInstance(); var tokens = JavaToCs.GetTokenCollection(activeList); foreach (Token token in tokens) { Token curToken = token.getPredecessor(); // remove the final states that are not the real final ones because // they're just hide prior final tokens: while (curToken.getPredecessor() != null && ((curToken.isFinal() && curToken.getPredecessor() != null && !curToken .getPredecessor().isFinal()) || (curToken.isEmitting() && curToken.getData() == null) // the // so // long // not // scored // tokens || (!curToken.isFinal() && !curToken.isEmitting()))) { curToken = curToken.getPredecessor(); } fixedList.add(curToken); } return(fixedList); }
public override void clearEmittingList() { ActiveList activeList = this.currentActiveLists[this.currentActiveLists.Length - 1]; this.currentActiveLists[this.currentActiveLists.Length - 1] = activeList.newInstance(); }