예제 #1
0
 public virtual void allocate()
 {
     this.dictionary.allocate();
     this.newGrammar();
     sphinx.util.Timer timer = TimerPool.getTimer(this, "grammarLoad");
     timer.start();
     this.initialNode = this.createGrammar();
     timer.stop();
 }
예제 #2
0
 public virtual void timeLinguist(int numRuns, int numFrames, int maxBeam)
 {
     java.util.Random  random = new java.util.Random((long)((ulong)1000));
     sphinx.util.Timer timer  = TimerPool.getTimer(this, "frameTimer");
     sphinx.util.Timer timer2 = TimerPool.getTimer(this, "totalTimer");
     [email protected](new StringBuilder().append("TestLinguist: runs ").append(numRuns).append(" frames ").append(numFrames).append(" beam ").append(maxBeam).toString());
     timer2.start();
     for (int i = 0; i < numRuns; i++)
     {
         int    num = 0;
         object obj = new ArrayList();
         ((ArrayList)obj).add(this.linguist.getSearchGraph().getInitialState());
         this.linguist.startRecognition();
         for (int j = 0; j < numFrames; j++)
         {
             object obj2 = obj;
             obj = new ArrayList(maxBeam * 10);
             timer.start();
             object obj3 = obj2;
             List   list;
             if (obj3 != null)
             {
                 if ((list = (obj3 as List)) == null)
                 {
                     throw new IncompatibleClassChangeError();
                 }
             }
             else
             {
                 list = null;
             }
             Iterator iterator = list.iterator();
             while (iterator.hasNext())
             {
                 SearchState searchState = (SearchState)iterator.next();
                 this.expandState(num, (ArrayList)obj, searchState);
             }
             timer.stop();
             Collections.shuffle((ArrayList)obj, random);
             if (((ArrayList)obj).size() > maxBeam)
             {
                 obj = ((ArrayList)obj).subList(0, maxBeam);
             }
         }
         this.linguist.stopRecognition();
     }
     timer2.stop();
     [email protected](new StringBuilder().append(" MaxSuccessors : ").append(this.maxSuccessors).toString());
     [email protected](new StringBuilder().append(" TotalStates   : ").append(this.totalStates).toString());
     [email protected](new StringBuilder().append(" TotalEmitting : ").append(this.totalEmittingStates).toString());
     [email protected](new StringBuilder().append("   NonEmitting : ").append(this.totalNonEmittingStates).toString());
     [email protected](new StringBuilder().append("  Final States : ").append(this.totalFinalStates).toString());
 }
예제 #3
0
 public override void allocate()
 {
     this.logger.info("Allocating DFLAT");
     this.allocateAcousticModel();
     this.grammar.allocate();
     this.hmmPool = new HMMPool(this.acousticModel, this.logger, this.unitManager);
     this.nodeToNextUnitArrayMap = new HashMap();
     this.nodeToUnitSetMap       = new HashMap();
     sphinx.util.Timer timer = TimerPool.getTimer(this, "compileGrammar");
     timer.start();
     this.compileGrammar();
     timer.stop();
     this.logger.info("Done allocating  DFLAT");
 }
예제 #4
0
 public override void allocate()
 {
     if (!this.allocated)
     {
         this.dictionary     = new HashMap();
         this.wordDictionary = new HashMap();
         sphinx.util.Timer timer = TimerPool.getTimer(this, "Load Dictionary");
         this.fillerWords = new HashSet();
         timer.start();
         this.logger.info(new StringBuilder().append("Loading dictionary from: ").append(this.wordDictionaryFile).toString());
         this.loadDictionary(this.wordDictionaryFile.openStream(), false);
         this.loadCustomDictionaries(this.addendaUrlList);
         this.logger.info(new StringBuilder().append("Loading filler dictionary from: ").append(this.fillerDictionaryFile).toString());
         this.loadDictionary(this.fillerDictionaryFile.openStream(), true);
         if (this.g2pModelFile != null && !String.instancehelper_equals(this.g2pModelFile.getPath(), ""))
         {
             this.g2pDecoder = new G2PConverter(this.g2pModelFile);
         }
         timer.stop();
     }
 }