private void createActiveLists() { int num = this.activeListFactories.size(); for (int i = 0; i < this.currentActiveLists.Length; i++) { int num2 = i; if (num2 >= num) { num2 = num - 1; } ActiveListFactory activeListFactory = (ActiveListFactory)this.activeListFactories.get(num2); this.currentActiveLists[i] = activeListFactory.newInstance(); } }
public SimpleBreadthFirstSearchManager(Linguist linguist, Pruner pruner, AcousticScorer scorer, ActiveListFactory activeListFactory, bool showTokenCount, double relativeWordBeamWidth, int growSkipInterval, bool wantEntryPruning) { this.name = Object.instancehelper_getClass(this).getName(); this.logger = Logger.getLogger(this.name); this.logMath = LogMath.getLogMath(); this.linguist = linguist; this.pruner = pruner; this.scorer = scorer; this.activeListFactory = activeListFactory; this._showTokenCount = showTokenCount; this.growSkipInterval = growSkipInterval; this.wantEntryPruning = wantEntryPruning; this.logRelativeWordBeamWidth = this.logMath.linearToLog(relativeWordBeamWidth); this.keepAllTokens = true; }
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); } }