Exemplo n.º 1
0
        /**
         * /// Performs the recognition for the given number of frames.
         *
         * /// @param nFrames the number of frames to recognize
         * /// @return the current result
         */
        override public Results.Result recognize(int nFrames)
        {
            Boolean done = false;

            Results.Result result = null;
            streamEnd = false;

            for (int i = 0; i < nFrames && !done; i++)
            {
                done = recognize();
            }

            if (!streamEnd)
            {
                result = new Results.Result(loserManager, activeList,
                                            resultList, currentFrameNumber, done, linguist.getSearchGraph().getWordTokenFirst());
            }

            // tokenTypeTracker.show();
            if (_showTokenCount)
            {
                showTokenCount();
            }
            return(result);
        }
Exemplo n.º 2
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();
        }