private void expandWord(UnitContext unitContext) { Word word = this.node.getWord(); FlatLinguist.access_100(this.this_0, new StringBuilder().append(" Expanding word ").append(word).append(" for lc ").append(unitContext).toString()); Pronunciation[] pronunciations = word.getPronunciations(); for (int i = 0; i < pronunciations.Length; i++) { this.expandPronunciation(unitContext, pronunciations[i], i); } }
private void expandPronunciation(UnitContext unitContext, Pronunciation pronunciation, int which) { UnitContext startingContext = this.getStartingContext(pronunciation); string name = new StringBuilder().append("P(").append(pronunciation.getWord()).append('[').append(unitContext).append(',').append(startingContext).append("])-G").append(this.getNode().getID()).toString(); PronunciationState pronunciationState = new PronunciationState(name, pronunciation, which); FlatLinguist.access_100(this.this_0, new StringBuilder().append(" Expanding ").append(pronunciationState.getPronunciation()).append(" for lc ").append(unitContext).toString()); ContextPair contextPair = ContextPair.get(unitContext, startingContext); List list = (List)this.entryPoints.get(contextPair); if (list == null) { string text = new StringBuilder().append("No EP list for context pair ").append(contextPair).toString(); throw new Error(text); } list.add(pronunciationState); Unit[] units = pronunciation.getUnits(); int num = units.Length - this.getRightContextSize(); if (num < 0) { num = 0; } SentenceHMMState sentenceHMMState = pronunciationState; int num2 = 0; while (sentenceHMMState != null && num2 < num) { sentenceHMMState = this.attachUnit(pronunciationState, sentenceHMMState, units, num2, unitContext, UnitContext.EMPTY); num2++; } SentenceHMMState sentenceHMMState2 = sentenceHMMState; Iterator iterator = this.rightContexts.iterator(); while (iterator.hasNext()) { UnitContext unitContext2 = (UnitContext)iterator.next(); sentenceHMMState = sentenceHMMState2; int num3 = num; while (sentenceHMMState != null && num3 < units.Length) { sentenceHMMState = this.attachUnit(pronunciationState, sentenceHMMState, units, num3, unitContext, unitContext2); num3++; } } }