Exemplo n.º 1
0
 private void connectSingleUnitWords(Unit lc, Node node, HashMap hashMap)
 {
     if (!this.singleUnitWords.isEmpty())
     {
         Iterator iterator = HMMTree.access_200(this.this_0).iterator();
         while (iterator.hasNext())
         {
             Unit    unit = (Unit)iterator.next();
             HMM     hmm  = HMMTree.access_100(this.this_0).getHMM(this.baseUnit, lc, unit, HMMPosition.__SINGLE);
             HMMNode hmmnode;
             if ((hmmnode = (HMMNode)hashMap.get(hmm)) == null)
             {
                 hmmnode = (HMMNode)node.addSuccessor(hmm, this.getProbability());
                 hashMap.put(hmm, hmmnode);
             }
             else
             {
                 node.putSuccessor(hmm, hmmnode);
             }
             hmmnode.addRC(unit);
             this.nodeCount++;
             Iterator iterator2 = this.singleUnitWords.iterator();
             while (iterator2.hasNext())
             {
                 Pronunciation pronunciation = (Pronunciation)iterator2.next();
                 if (pronunciation.getWord() == HMMTree.access_300(this.this_0).getSentenceStartWord())
                 {
                     HMMTree.access_402(this.this_0, new InitialWordNode(pronunciation, hmmnode));
                 }
                 else
                 {
                     float    num      = HMMTree.access_500(this.this_0, pronunciation.getWord());
                     WordNode wordNode = hmmnode.addSuccessor(pronunciation, num, HMMTree.access_600(this.this_0));
                     if (pronunciation.getWord() == HMMTree.access_300(this.this_0).getSentenceEndWord())
                     {
                         HMMTree.access_702(this.this_0, wordNode);
                     }
                 }
                 this.nodeCount++;
             }
         }
     }
 }
Exemplo n.º 2
0
            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++;
                    }
                }
            }
Exemplo n.º 3
0
 internal WordNode(Pronunciation pronunciation, float num) : base(num)
 {
     this.pronunciation = pronunciation;
     this._isFinal      = pronunciation.getWord().isSentenceEndWord();
 }