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;
 }
Пример #2
0
 /**
  *
  * @param logMath
  * @param linguist
  * @param pruner
  * @param scorer
  * @param activeListFactory
  * @param showTokenCount
  * @param relativeWordBeamWidth
  * @param growSkipInterval
  * @param wantEntryPruning
  */
 public AlignerSearchManager(LogMath logMath, edu.cmu.sphinx.linguist.Linguist linguist,
                             Pruner pruner, AcousticScorer scorer,
                             ActiveListFactory activeListFactory, bool showTokenCount,
                             double relativeWordBeamWidth, int growSkipInterval,
                             bool wantEntryPruning)
 {
     this.name                     = getClass().getName();
     this.logger                   = LogManager.GetLogger(name);
     this.logMath                  = logMath;
     this.linguist                 = linguist;
     this.pruner                   = pruner;
     this.scorer                   = scorer;
     this.activeListFactory        = activeListFactory;
     this.showTokenCountP          = showTokenCount;
     this.growSkipInterval         = growSkipInterval;
     this.wantEntryPruning         = wantEntryPruning;
     this.logRelativeWordBeamWidth = logMath
                                     .linearToLog(relativeWordBeamWidth);
     this.keepAllTokens  = false;
     this.phraseWordList = new List <String>();
 }
Пример #3
0
        //@Override
        public override void newProperties(PropertySheet ps)
        {
            base.newProperties(ps);

            //logger = ps.getLogger();
            name = ps.getInstanceName();

            logMath = (LogMath)ps.getComponent(PROP_LOG_MATH);

            linguist          = (edu.cmu.sphinx.linguist.Linguist)ps.getComponent(PROP_LINGUIST);
            pruner            = (Pruner)ps.getComponent(PROP_PRUNER);
            scorer            = (AcousticScorer)ps.getComponent(PROP_SCORER);
            activeListFactory = (ActiveListFactory)ps
                                .getComponent(PROP_ACTIVE_LIST_FACTORY);
            showTokenCountP = JavaToCs.ConvertBool(ps.getBoolean(PROP_SHOW_TOKEN_COUNT));

            double relativeWordBeamWidth = ps.getDouble(PROP_RELATIVE_WORD_BEAM_WIDTH);

            growSkipInterval         = ps.getInt(PROP_GROW_SKIP_INTERVAL);
            wantEntryPruning         = JavaToCs.ConvertBool(ps.getBoolean(PROP_WANT_ENTRY_PRUNING));
            logRelativeWordBeamWidth = logMath.linearToLog(relativeWordBeamWidth);

            this.keepAllTokens = true;
        }
Пример #4
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);
 }