Пример #1
0
 public WordPruningBreadthFirstLookaheadSearchManager(Linguist.Linguist linguist, Linguist.Linguist fastmatchLinguist, ILoader loader,
                                                      IPruner pruner, IAcousticScorer 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)
 {
     _loader                     = loader;
     _fastmatchLinguist          = fastmatchLinguist;
     _fastmatchActiveListFactory = fastmatchActiveListFactory;
     _lookaheadWindow            = lookaheadWindow;
     _lookaheadWeight            = lookaheadWeight;
     if (lookaheadWindow < 1 || lookaheadWindow > 10)
     {
         throw new ArgumentException("Unsupported lookahead window size: " + lookaheadWindow
                                     + ". Value in range [1..10] is expected");
     }
     _ciScores  = new LinkedList <FrameCiScores>();
     _penalties = new HashMap <Integer, Float>();
     if (loader is Sphinx3Loader && ((Sphinx3Loader)loader).HasTiedMixtures())
     {
         ((Sphinx3Loader)loader).SetGauScoresQueueLength(lookaheadWindow + 2);
     }
 }
Пример #2
0
        /*
         * /// (non-Javadoc)
         *
         * /// @see edu.cmu.sphinx.util.props.Configurable#newProperties(edu.cmu.sphinx.util.props.PropertySheet)
         */

        public override void newProperties(PropertySheet ps)
        {
            logMath = LogMath.getLogMath();

            linguist          = (Linguist.Linguist)ps.getComponent(PROP_LINGUIST);
            pruner            = (IPruner)ps.getComponent(PROP_PRUNER);
            scorer            = (IAcousticScorer)ps.getComponent(PROP_SCORER);
            activeListManager = (ActiveListManager)ps.getComponent(PROP_ACTIVE_LIST_MANAGER);
            _showTokenCount   = ps.getBoolean(PROP_SHOW_TOKEN_COUNT);
            growSkipInterval  = ps.getInt(PROP_GROW_SKIP_INTERVAL);

            _checkStateOrder        = ps.getBoolean(PROP_CHECK_STATE_ORDER);
            maxLatticeEdges         = ps.getInt(PROP_MAX_LATTICE_EDGES);
            acousticLookaheadFrames = ps.getFloat(PROP_ACOUSTIC_LOOKAHEAD_FRAMES);

            relativeBeamWidth = logMath.linearToLog(ps.getDouble(PROP_RELATIVE_BEAM_WIDTH));
        }
Пример #3
0
 /**
  * ///
  * /// @param linguist
  * /// @param pruner
  * /// @param scorer
  * /// @param activeListFactory
  * /// @param showTokenCount
  * /// @param relativeWordBeamWidth
  * /// @param growSkipInterval
  * /// @param wantEntryPruning
  */
 public SimpleBreadthFirstSearchManager(Linguist.Linguist linguist, IPruner pruner,
                                        IAcousticScorer scorer, ActiveListFactory activeListFactory,
                                        Boolean showTokenCount, double relativeWordBeamWidth,
                                        int growSkipInterval, Boolean wantEntryPruning)
 {
     this.name                     = GetType().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 = logMath.linearToLog(relativeWordBeamWidth);
     this.keepAllTokens            = true;
 }
Пример #4
0
 /**
  * ///
  * /// @param linguist
  * /// @param pruner
  * /// @param scorer
  * /// @param activeListFactory
  * /// @param showTokenCount
  * /// @param relativeWordBeamWidth
  * /// @param growSkipInterval
  * /// @param wantEntryPruning
  */
 public SimpleBreadthFirstSearchManager(Linguist.Linguist linguist, IPruner pruner,
                                        IAcousticScorer scorer, ActiveListFactory activeListFactory,
                                        Boolean showTokenCount, double relativeWordBeamWidth,
                                        int growSkipInterval, Boolean wantEntryPruning, int totalHmms)
 {
     _name                     = GetType().Name;
     LogMath                   = LogMath.GetLogMath();
     Linguist                  = linguist;
     _pruner                   = pruner;
     _scorer                   = scorer;
     ActiveListFactory         = activeListFactory;
     _showTokenCount           = showTokenCount;
     _growSkipInterval         = growSkipInterval;
     _wantEntryPruning         = wantEntryPruning;
     _totalHmms                = totalHmms;
     _logRelativeWordBeamWidth = LogMath.LinearToLog(relativeWordBeamWidth);
     KeepAllTokens             = true;
 }
Пример #5
0
        public override void NewProperties(PropertySheet ps)
        {
            LogMath = LogMath.GetLogMath();
            _name   = ps.InstanceName;

            Linguist          = (Linguist.Linguist)ps.GetComponent(PropLinguist);
            _pruner           = (IPruner)ps.GetComponent(PropPruner);
            _scorer           = (IAcousticScorer)ps.GetComponent(PropScorer);
            ActiveListFactory = (ActiveListFactory)ps.GetComponent(PropActiveListFactory);
            _showTokenCount   = ps.GetBoolean(PropShowTokenCount);

            double relativeWordBeamWidth = ps.GetDouble(PropRelativeWordBeamWidth);

            _growSkipInterval         = ps.GetInt(PropGrowSkipInterval);
            _wantEntryPruning         = ps.GetBoolean(PropWantEntryPruning);
            _logRelativeWordBeamWidth = LogMath.LinearToLog(relativeWordBeamWidth);

            KeepAllTokens = true;
        }
        public override void NewProperties(PropertySheet ps)
        {
            base.NewProperties(ps);

            _logMath = LogMath.GetLogMath();

            Linguist           = (Linguist.Linguist)ps.GetComponent(PropLinguist);
            Pruner             = (IPruner)ps.GetComponent(PropPruner);
            Scorer             = (IAcousticScorer)ps.GetComponent(PropScorer);
            _activeListManager = (ActiveListManager)ps.GetComponent(PropActiveListManager);
            _showTokenCount    = ps.GetBoolean(PropShowTokenCount);
            _growSkipInterval  = ps.GetInt(PropGrowSkipInterval);

            _checkStateOrder         = ps.GetBoolean(PropCheckStateOrder);
            _maxLatticeEdges         = ps.GetInt(PropMaxLatticeEdges);
            _acousticLookaheadFrames = ps.GetFloat(PropAcousticLookaheadFrames);

            _relativeBeamWidth = _logMath.LinearToLog(ps.GetDouble(PropRelativeBeamWidth));
        }
Пример #7
0
        override public void newProperties(PropertySheet ps)
        {
            logMath = LogMath.getLogMath();
            name    = ps.InstanceName;

            linguist          = (Linguist.Linguist)ps.getComponent(PROP_LINGUIST);
            pruner            = (IPruner)ps.getComponent(PROP_PRUNER);
            scorer            = (IAcousticScorer)ps.getComponent(PROP_SCORER);
            activeListFactory = (ActiveListFactory)ps.getComponent(PROP_ACTIVE_LIST_FACTORY);
            _showTokenCount   = ps.getBoolean(PROP_SHOW_TOKEN_COUNT);

            double relativeWordBeamWidth = ps.getDouble(PROP_RELATIVE_WORD_BEAM_WIDTH);

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

            this.keepAllTokens = true;
        }
Пример #8
0
        /**
         * ///
         * /// @param linguist
         * /// @param pruner
         * /// @param scorer
         * /// @param activeListManager
         * /// @param showTokenCount
         * /// @param relativeWordBeamWidth
         * /// @param growSkipInterval
         * /// @param checkStateOrder
         * /// @param buildWordLattice
         * /// @param maxLatticeEdges
         * /// @param acousticLookaheadFrames
         * /// @param keepAllTokens
         */
        public WordPruningBreadthFirstSearchManager(Linguist.Linguist linguist, IPruner pruner,
                                                    IAcousticScorer scorer, ActiveListManager activeListManager,
                                                    Boolean showTokenCount, double relativeWordBeamWidth,
                                                    int growSkipInterval,
                                                    Boolean checkStateOrder, Boolean buildWordLattice,
                                                    int maxLatticeEdges, float acousticLookaheadFrames,
                                                    Boolean keepAllTokens)
        {
            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 = logMath.linearToLog(relativeWordBeamWidth);
        }
        public WordPruningBreadthFirstSearchManager(Linguist.Linguist linguist, IPruner pruner,
                                                    IAcousticScorer scorer, ActiveListManager activeListManager,
                                                    Boolean showTokenCount, double relativeWordBeamWidth,
                                                    int growSkipInterval,
                                                    Boolean checkStateOrder, Boolean buildWordLattice,
                                                    int maxLatticeEdges, float acousticLookaheadFrames,
                                                    Boolean keepAllTokens)
        {
            _logMath                 = LogMath.GetLogMath();
            Linguist                 = linguist;
            Pruner                   = pruner;
            Scorer                   = scorer;
            _activeListManager       = activeListManager;
            _showTokenCount          = showTokenCount;
            _growSkipInterval        = growSkipInterval;
            _checkStateOrder         = checkStateOrder;
            BuildWordLattice         = buildWordLattice;
            _maxLatticeEdges         = maxLatticeEdges;
            _acousticLookaheadFrames = acousticLookaheadFrames;
            KeepAllTokens            = keepAllTokens;

            _relativeBeamWidth = _logMath.LinearToLog(relativeWordBeamWidth);
        }