/* * (non-Javadoc) * @see edu.cmu.sphinx.decoder.search.SearchManager#allocate() */ //@Override public override void allocate() { totalTokensScored = StatisticsVariable .getStatisticsVariable("totalTokensScored"); tokensPerSecond = StatisticsVariable .getStatisticsVariable("tokensScoredPerSecond"); curTokensScored = StatisticsVariable .getStatisticsVariable("curTokensScored"); tokensCreated = StatisticsVariable .getStatisticsVariable("tokensCreated"); viterbiPruned = StatisticsVariable .getStatisticsVariable("viterbiPruned"); beamPruned = StatisticsVariable.getStatisticsVariable("beamPruned"); try { linguist.allocate(); pruner.allocate(); scorer.allocate(); } catch (IOException e) { throw new SystemException( "Allocation of search manager resources failed", e); } scoreTimer = TimerPool.getTimer(this, "Score"); pruneTimer = TimerPool.getTimer(this, "Prune"); growTimer = TimerPool.getTimer(this, "Grow"); }
public override void allocate() { this.allocateAcousticModel(); this.grammar.allocate(); this.totalStates = StatisticsVariable.getStatisticsVariable(this.getName(), "totalStates"); this.totalArcs = StatisticsVariable.getStatisticsVariable(this.getName(), "totalArcs"); this.actualArcs = StatisticsVariable.getStatisticsVariable(this.getName(), "actualArcs"); this.stateSet = this.compileGrammar(); this.totalStates.value = (double)this.stateSet.size(); }
public override void allocate() { this.scoreTimer = TimerPool.getTimer(this, "Score"); this.pruneTimer = TimerPool.getTimer(this, "Prune"); this.growTimer = TimerPool.getTimer(this, "Grow"); this.totalTokensScored = StatisticsVariable.getStatisticsVariable("totalTokensScored"); this.curTokensScored = StatisticsVariable.getStatisticsVariable("curTokensScored"); this.tokensCreated = StatisticsVariable.getStatisticsVariable("tokensCreated"); try { this.linguist.allocate(); this.pruner.allocate(); this.scorer.allocate(); } catch (IOException ex) { throw new RuntimeException("Allocation of search manager resources failed", ex); } }
/* * /// (non-Javadoc) * * /// @see edu.cmu.sphinx.decoder.search.SearchManager#allocate() */ override public void allocate() { // tokenTracker = new TokenTracker(); // tokenTypeTracker = new TokenTypeTracker(); scoreTimer = TimerPool.getTimer(this, "Score"); pruneTimer = TimerPool.getTimer(this, "Prune"); growTimer = TimerPool.getTimer(this, "Grow"); totalTokensScored = StatisticsVariable.getStatisticsVariable("totalTokensScored"); curTokensScored = StatisticsVariable.getStatisticsVariable("curTokensScored"); tokensCreated = StatisticsVariable.getStatisticsVariable("tokensCreated"); try { linguist.allocate(); pruner.allocate(); scorer.allocate(); } catch (IOException e) { throw new SystemException("Allocation of search manager resources failed", e); } }
public static void main(string[] argv) { if (argv.Length < 2) { [email protected]("Usage: BatchDecoder propertiesFile batchFile [-shell]"); java.lang.System.exit(1); } string text = argv[0]; string text2 = argv[1]; try { URL url = new File(text).toURI().toURL(); ConfigurationManager configurationManager = new ConfigurationManager(url); BatchModeRecognizer batchModeRecognizer = (BatchModeRecognizer)configurationManager.lookup("batch"); if (batchModeRecognizer != null) { if (argv.Length >= 3 && String.instancehelper_equals(argv[2], "-shell")) { batchModeRecognizer.shell(text2); } else { batchModeRecognizer.decode(text2); } [email protected](new StringBuilder().append("Tokens created: ").append(StatisticsVariable.getStatisticsVariable("totalTokensScored").value).toString()); } java.lang.System.err.println(new StringBuilder().append("Can't find batchModeRecognizer in ").append(text).toString()); } catch (System.Exception ex) { java.lang.System.err.println("Error during decoding: \n "); Throwable.instancehelper_printStackTrace(ex); } }