Exemplo n.º 1
0
        public WordPruningBreadthFirstLookaheadSearchManager(Linguist linguist, Linguist fastmatchLinguist, Loader loader, Pruner pruner, AcousticScorer scorer, ActiveListManager activeListManager, ActiveListFactory fastmatchActiveListFactory, bool showTokenCount, double relativeWordBeamWidth, int growSkipInterval, bool checkStateOrder, bool buildWordLattice, int lookaheadWindow, float lookaheadWeight, int maxLatticeEdges, float acousticLookaheadFrames, bool keepAllTokens) : base(linguist, pruner, scorer, activeListManager, showTokenCount, relativeWordBeamWidth, growSkipInterval, checkStateOrder, buildWordLattice, maxLatticeEdges, acousticLookaheadFrames, keepAllTokens)
        {
            this.loader                     = loader;
            this.fastmatchLinguist          = fastmatchLinguist;
            this.fastmatchActiveListFactory = fastmatchActiveListFactory;
            this.lookaheadWindow            = lookaheadWindow;
            this.lookaheadWeight            = lookaheadWeight;
            if (lookaheadWindow < 1 || lookaheadWindow > 10)
            {
                string text = new StringBuilder().append("Unsupported lookahead window size: ").append(lookaheadWindow).append(". Value in range [1..10] is expected").toString();

                throw new IllegalArgumentException(text);
            }
            this.ciScores  = new LinkedList();
            this.penalties = new HashMap();
            if (loader is Sphinx3Loader && ((Sphinx3Loader)loader).hasTiedMixtures())
            {
                ((Sphinx3Loader)loader).setGauScoresQueueLength(lookaheadWindow + 2);
            }
        }
 public WordPruningBreadthFirstSearchManager(Linguist linguist, Pruner pruner, AcousticScorer scorer, ActiveListManager activeListManager, bool showTokenCount, double relativeWordBeamWidth, int growSkipInterval, bool checkStateOrder, bool buildWordLattice, int maxLatticeEdges, float acousticLookaheadFrames, bool keepAllTokens)
 {
     this.maxLatticeEdges         = 100;
     this.logger                  = Logger.getLogger(Object.instancehelper_getClass(this).getName());
     this.logMath                 = LogMath.getLogMath();
     this.linguist                = linguist;
     this.pruner                  = pruner;
     this.scorer                  = scorer;
     this.activeListManager       = activeListManager;
     this._showTokenCount         = showTokenCount;
     this.growSkipInterval        = growSkipInterval;
     this._checkStateOrder        = checkStateOrder;
     this.buildWordLattice        = buildWordLattice;
     this.maxLatticeEdges         = maxLatticeEdges;
     this.acousticLookaheadFrames = acousticLookaheadFrames;
     this.keepAllTokens           = keepAllTokens;
     this.relativeBeamWidth       = this.logMath.linearToLog(relativeWordBeamWidth);
 }