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));
        }
        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);
        }
Exemple #3
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);
     }
 }