/** * Goes through the active list of tokens and expands each token, finding * the set of successor tokens until all the successor tokens are emitting * tokens. */ protected void growBranches() { int mapSize = activeList.size() * 10; if (mapSize == 0) { mapSize = 1; } growTimer.start(); bestTokenMap = new Dictionary <SearchState, Token>(mapSize); ActiveList oldActiveList = activeList; resultList = new List <Token>(); activeList = activeListFactory.newInstance(); threshold = oldActiveList.getBeamThreshold(); wordThreshold = oldActiveList.getBestScore() + logRelativeWordBeamWidth; var tokens = JavaToCs.GetTokenCollection(oldActiveList); foreach (Token token in tokens) { collectSuccessorTokens(token); } growTimer.stop(); if (logger.IsInfoEnabled) { int hmms = activeList.size(); totalHmms += hmms; logger.Info("Frame: " + currentFrameNumber + " Hmms: " + hmms + " total " + totalHmms); } }
/** Removes unpromising branches from the active list */ protected void pruneBranches() { int startSize = activeList.size(); pruneTimer.start(); activeList = pruner.prune(activeList); beamPruned.value += startSize - activeList.size(); pruneTimer.stop(); }
/** * Performs recognition for one frame. Returns true if recognition has been * completed. * * @return <code>true</code> if recognition is completed. */ protected bool recognize() { bool more = scoreTokens(); // score emitting tokens phraseDetected = false; if (more) { pruneBranches(); // eliminate poor branches if (phraseDetected) { logger.Info("Active List Pruned: number of active Token: " + activeList.size()); } logger.Info("Pruning Done: Number of Active tokens: " + activeList.size()); currentFrameNumber++; if (growSkipInterval == 0 || (currentFrameNumber % growSkipInterval) != 0) { phraseDetected = false; logger.Info("---------- Grow Branches Step : Start ---------"); growBranches(); // extend remaining branches logger.Info("---------- Grow Branches Step : Over ----------"); } logCounter++; } return(!more); }
private void checkPriorLists() { for (int i = 0; i < this.listPtr; i++) { ActiveList activeList = SimpleActiveListManager.access_000(this.this_0)[i]; if (activeList.size() > 0) { string text = new StringBuilder().append("At while processing state order").append(this.listPtr).append(", state order ").append(i).append(" not empty").toString(); throw new Error(text); } } }
protected internal virtual void monitorStates(ActiveList activeList) { this.tokenSum += (long)activeList.size(); this.tokenCount++; bool flag = this.tokenCount != 0; int num = 1000; if (num == -1 || (flag ? 1 : 0) % num == 0) { Logger logger = this.logger; StringBuilder stringBuilder = new StringBuilder().append("Average Tokens/State: "); long num2 = this.tokenSum; long num3 = (long)this.tokenCount; logger.info(stringBuilder.append((num3 != -1L) ? (num2 / num3) : (-num2)).toString()); } }
private void dumpList(ActiveList activeList) { [email protected](new StringBuilder().append("Size: ").append(activeList.size()).append(" Best token: ").append(activeList.getBestToken()).toString()); }