Exemple #1
0
            internal void dump()
            {
                Iterator iterator = this.entryPoints.values().iterator();

                while (iterator.hasNext())
                {
                    HMMTree.EntryPoint entryPoint = (HMMTree.EntryPoint)iterator.next();
                    entryPoint.dump();
                }
            }
Exemple #2
0
        private void addPronunciation(Pronunciation pronunciation, float num)
        {
            Unit[] units = pronunciation.getUnits();
            Unit   unit  = units[0];

            HMMTree.EntryPoint entryPoint = this.entryPointTable.getEntryPoint(unit);
            entryPoint.addProbability(num);
            if (units.Length > 1)
            {
                Node node  = entryPoint.getNode();
                Unit unit2 = unit;
                for (int i = 1; i < units.Length - 1; i++)
                {
                    unit = units[i];
                    Unit unit3 = units[i + 1];
                    HMM  hmm   = this.hmmPool.getHMM(unit, unit2, unit3, HMMPosition.__INTERNAL);
                    if (hmm == null)
                    {
                        this.logger.severe(new StringBuilder().append("Missing HMM for unit ").append(unit.getName()).append(" with lc=").append(unit2.getName()).append(" rc=").append(unit3.getName()).toString());
                    }
                    else
                    {
                        node = node.addSuccessor(hmm, num);
                    }
                    unit2 = unit;
                }
                unit = units[units.Length - 1];
                EndNode  endNode  = new EndNode(unit, unit2, num);
                EndNode  endNode2 = node.addSuccessor(endNode, num);
                WordNode wordNode = endNode2.addSuccessor(pronunciation, num, this.wordNodeMap);
                if (wordNode.getWord().isSentenceEndWord())
                {
                    this.sentenceEndWordNode = wordNode;
                }
            }
            else
            {
                entryPoint.addSingleUnitWord(pronunciation);
            }
        }
Exemple #3
0
 public Node[] getEntryPoint(Unit unit, Unit unit2)
 {
     HMMTree.EntryPoint entryPoint = this.entryPointTable.getEntryPoint(unit2);
     return(entryPoint.getEntryPointsFromLeftContext(unit).getSuccessors());
 }