예제 #1
0
            public override ActiveList purge()
            {
                int     num     = 0;
                HashMap hashMap = new HashMap();

                Collections.sort(this.tokenList, Scoreable.COMPARATOR);
                Iterator iterator = this.tokenList.iterator();

                while (iterator.hasNext())
                {
                    Token           token           = (Token)iterator.next();
                    WordSearchState wordSearchState = (WordSearchState)token.getSearchState();
                    Word            word            = wordSearchState.getPronunciation().getWord();
                    if (WordActiveListFactory.access_000(this.this_0) > 0 && word.isFiller())
                    {
                        if (num >= WordActiveListFactory.access_000(this.this_0))
                        {
                            iterator.remove();
                            continue;
                        }
                        num++;
                    }
                    if (WordActiveListFactory.access_100(this.this_0) > 0)
                    {
                        Integer integer = (Integer)hashMap.get(word);
                        int     num2    = (integer != null) ? integer.intValue() : 0;
                        if (num2 < WordActiveListFactory.access_100(this.this_0) - 1)
                        {
                            hashMap.put(word, Integer.valueOf(num2 + 1));
                        }
                        else
                        {
                            iterator.remove();
                        }
                    }
                }
                if (this.tokenList.size() > this.this_0.absoluteBeamWidth)
                {
                    this.tokenList = this.tokenList.subList(0, this.this_0.absoluteBeamWidth);
                }
                return(this);
            }
예제 #2
0
 internal WordActiveList(WordActiveListFactory wordActiveListFactory)
 {
     this_0         = wordActiveListFactory;
     this.tokenList = new LinkedList();
 }
예제 #3
0
 internal static int access_100(WordActiveListFactory wordActiveListFactory)
 {
     return(wordActiveListFactory.maxPathsPerWord);
 }
예제 #4
0
 internal static int access_000(WordActiveListFactory wordActiveListFactory)
 {
     return(wordActiveListFactory.maxFiller);
 }