Пример #1
0
        /// <summary>
        /// Gets the initial grammar node from the linguist and creates a GrammarNodeToken.
        /// </summary>
        protected void localStart()
        {
            currentFrameNumber    = 0;
            curTokensScored.value = 0;
            ActiveList   newActiveList = activeListFactory.newInstance();
            ISearchState state         = linguist.getSearchGraph().getInitialState();

            newActiveList.add(new Token(state, currentFrameNumber));
            activeList = newActiveList;

            growBranches();
        }
Пример #2
0
        /**
         * /// Creates the emitting and non-emitting active lists. When creating the non-emitting active lists, we will look at
         * /// their respective beam widths (eg, word beam, unit beam, state beam).
         */
        private void createActiveLists()
        {
            int nlists = activeListFactories.Count;

            for (int i = 0; i < currentActiveLists.Length; i++)
            {
                int which = i;
                if (which >= nlists)
                {
                    which = nlists - 1;
                }
                ActiveListFactory alf = activeListFactories[which];
                currentActiveLists[i] = alf.newInstance();
            }
        }