Ejemplo n.º 1
0
 protected internal virtual Token getResultListPredecessor(Token token)
 {
     if (this.keepAllTokens)
     {
         return(token);
     }
     if (this.buildWordLattice)
     {
         float num  = 0f;
         float num2 = 0f;
         float num3 = 0f;
         while (token != null && !token.isWord())
         {
             num  += token.getAcousticScore();
             num2 += token.getLanguageScore();
             num3 += token.getInsertionScore();
             token = token.getPredecessor();
         }
         return(new Token(token, token.getScore(), num3, num, num2));
     }
     if (token.isWord())
     {
         return(token);
     }
     return(token.getPredecessor());
 }
        protected internal virtual void growEmittingBranches()
        {
            if (this.acousticLookaheadFrames <= 0f)
            {
                this.growBranches();
                return;
            }
            this.growTimer.start();
            float    num      = float.MinValue;
            Iterator iterator = this.activeList.iterator();

            while (iterator.hasNext())
            {
                Token token = (Token)iterator.next();
                float num2  = token.getScore() + token.getAcousticScore() * this.acousticLookaheadFrames;
                if (num2 > num)
                {
                    num = num2;
                }
            }
            float    num3      = num + this.relativeBeamWidth;
            Iterator iterator2 = this.activeList.iterator();

            while (iterator2.hasNext())
            {
                Token token2 = (Token)iterator2.next();
                if (token2.getScore() + token2.getAcousticScore() * this.acousticLookaheadFrames > num3)
                {
                    this.collectSuccessorTokens(token2);
                }
            }
            this.growTimer.stop();
        }