Ejemplo n.º 1
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();

            _acousticModel = (AcousticModel)ps.GetComponent(PropAcousticModel);
            Grammar        = (Grammar)ps.GetComponent(PropGrammar);
            UnitManager    = (UnitManager)ps.GetComponent(PropUnitManager);

            // get the rest of the configuration data
            _logWordInsertionProbability   = LogMath.LinearToLog(ps.GetDouble(PropWordInsertionProbability));
            LogSilenceInsertionProbability = LogMath.LinearToLog(ps.GetDouble(PropSilenceInsertionProbability));
            _logFillerInsertionProbability = LogMath.LinearToLog(ps.GetDouble(PropFillerInsertionProbability));
            _logUnitInsertionProbability   = LogMath.LinearToLog(ps.GetDouble(PropUnitInsertionProbability));
            _languageWeight          = ps.GetFloat(PropLanguageWeight);
            _dumpGStates             = ps.GetBoolean(PropDumpGstates);
            _showCompilationProgress = ps.GetBoolean(PropShowCompilationProgress);
            _spreadWordProbabilitiesAcrossPronunciations = ps.GetBoolean(PropSpreadWordProbabilitiesAcrossPronunciations);

            AddOutOfGrammarBranch = ps.GetBoolean(PropAddOutOfGrammarBranch);

            if (AddOutOfGrammarBranch)
            {
                LogOutOfGrammarBranchProbability = LogMath.LinearToLog(ps.GetDouble(PropOutOfGrammarProbability));
                LogPhoneInsertionProbability     = LogMath.LinearToLog(ps.GetDouble(PropPhoneInsertionProbability));
                PhoneLoopAcousticModel           = (AcousticModel)ps.GetComponent(PropPhoneLoopAcousticModel);
            }

            Name = ps.InstanceName;
        }
Ejemplo n.º 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();

            _acousticModel = (AcousticModel)ps.GetComponent(PropAcousticModel);
            _unitManager   = (UnitManager)ps.GetComponent(PropUnitManager);
            LanguageModel  = (LanguageModel)ps.GetComponent(PropLanguageModel);
            Dictionary     = (IDictionary)ps.GetComponent(PropDictionary);

            //fullWordHistories = ps.getBoolean(PROP_FULL_WORD_HISTORIES);
            _wantUnigramSmear               = ps.GetBoolean(PropWantUnigramSmear);
            _logWordInsertionProbability    = _logMath.LinearToLog(ps.GetDouble(PropWordInsertionProbability));
            _logSilenceInsertionProbability = _logMath.LinearToLog(ps.GetDouble(PropSilenceInsertionProbability));
            _logFillerInsertionProbability  = _logMath.LinearToLog(ps.GetDouble(PropFillerInsertionProbability));
            _logUnitInsertionProbability    = _logMath.LinearToLog(ps.GetDouble(PropUnitInsertionProbability));
            LanguageWeight      = ps.GetFloat(PropLanguageWeight);
            AddFillerWords      = (ps.GetBoolean(PropAddFillerWords));
            GenerateUnitStates  = (ps.GetBoolean(PropGenerateUnitStates));
            _unigramSmearWeight = ps.GetFloat(PropUnigramSmearWeight);
            _maxArcCacheSize    = ps.GetInt(PropCacheSize);

            CacheEnabled = _maxArcCacheSize > 0;
            if (CacheEnabled)
            {
                ArcCache = new LRUCache <LexTreeState, ISearchStateArc[]>(_maxArcCacheSize);
            }
        }
Ejemplo n.º 3
0
 public override void NewProperties(PropertySheet ps)
 {
     base.NewProperties(ps);
     FrontEnd         = (BaseDataProcessor)ps.GetComponent(FeatureFrontend);
     _scoreNormalizer = (IScoreNormalizer)ps.GetComponent(ScoreNormalizer);
     _storedData      = new LinkedList <IData>();
 }
Ejemplo n.º 4
0
 /*
  * (non-Javadoc)
  *
  * @see edu.cmu.sphinx.util.props.Configurable#newProperties(edu.cmu.sphinx.util.props.PropertySheet)
  */
 public override void NewProperties(PropertySheet ps)
 {
     base.NewProperties(ps);
     InitRecognizer((Recognizer)ps.GetComponent(PropRecognizer));
     InitFrontEnd((FrontEnd)ps.GetComponent(PropFrontend));
     _showSummary      = ps.GetBoolean(PropShowSummary);
     _showDetails      = ps.GetBoolean(PropShowDetails);
     _showResponseTime = ps.GetBoolean(PropShowResponseTime);
     _showTimers       = ps.GetBoolean(PropShowTimers);
 }
Ejemplo n.º 5
0
        public void  NewProperties(PropertySheet propertySheet)
        {
            _decoder  = (Decoder)propertySheet.GetComponent(PropDecoder);
            _monitors = propertySheet.GetComponentList <IMonitor>(PropMonitors);

            _name = propertySheet.InstanceName;
        }
Ejemplo n.º 6
0
 public void NewProperties(PropertySheet ps)
 {
     _frontEnd  = (DummyFrontEnd)ps.GetComponent(PropFrontend);
     _beamWidth = ps.GetInt(PropBeamWidth);
     _bestAsr   = ps.GetString(PropBestAsr);
     _alpha     = ps.GetDouble(PropAlpha);
     _useFooBaz = ps.GetBoolean(PropUseFoobaz);
 }
Ejemplo n.º 7
0
        /*
         * /// (non-Javadoc)
         *
         * /// @see edu.cmu.sphinx.util.props.Configurable#newProperties(edu.cmu.sphinx.util.props.PropertySheet)
         */
        public virtual void NewProperties(PropertySheet ps)
        {
            _optimizeGrammar = ps.GetBoolean(PropOptimizeGrammar);

            _addSilenceWords = ps.GetBoolean(PropAddSilWords);
            _addFillerWords  = ps.GetBoolean(PropAddFillerWords);

            Dictionary = (IDictionary)ps.GetComponent(PropDictionary);
        }
Ejemplo n.º 8
0
        /*
         * (non-Javadoc)
         *
         * @see edu.cmu.sphinx.util.props.Configurable#newProperties(edu.cmu.sphinx.util.props.PropertySheet)
         */
        public override void NewProperties(PropertySheet ps)
        {
            base.NewProperties(ps);
            Recognizer newRecognizer = (Recognizer)ps.GetComponent(
                PropRecognizer);

            InitRecognizer(newRecognizer);
            _showSummary = ps.GetBoolean(PropShowSummary);
            _showDetails = ps.GetBoolean(PropShowDetails);
        }
Ejemplo n.º 9
0
        /*
         * (non-Javadoc)
         *
         * @see
         * edu.cmu.sphinx.util.props.Configurable#newProperties(edu.cmu.sphinx.util
         * .props.PropertySheet)
         */

        public override void NewProperties(PropertySheet ps)
        {
            wordDictionaryFile   = ConfigurationManagerUtils.GetResource(PropDictionary, ps);
            fillerDictionaryFile = ConfigurationManagerUtils.GetResource(PropFillerDictionary, ps);
            addendaUrlList       = ps.GetResourceList(PropAddenda);
            wordReplacement      = ps.GetString(PropWordReplacement);
            unitManager          = (UnitManager)ps.GetComponent(PropUnitManager);
            g2pModelFile         = ConfigurationManagerUtils.GetResource(PropG2PModelPath, ps);
            g2pMaxPron           = ps.GetInt(PropG2PMaxPronunciations);
        }
        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));
        }
Ejemplo n.º 11
0
 public void NewProperties(PropertySheet ps)
 {
     Init(ConfigurationManagerUtils.GetResource(PropLocation, ps),
          ps.GetString(PropModel), ps.GetString(PropDataLocation),
          (UnitManager)ps.GetComponent(PropUnitManager),
          ps.GetFloat(PropMcFloor), ps.GetFloat(PropMwFloor),
          ps.GetFloat(PropVarianceFloor),
          ps.GetInt(PropTopn),
          ps.GetBoolean(PropUseCdUnits));
 }
Ejemplo n.º 12
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;
        }
Ejemplo n.º 13
0
        public override void NewProperties(PropertySheet ps)
        {
            base.NewProperties(ps);

            _fastmatchLinguist          = (Linguist.Linguist)ps.GetComponent(PropFastmatchLinguist);
            _fastmatchActiveListFactory = (ActiveListFactory)ps.GetComponent(PropFmActiveListFactory);
            _loader          = (ILoader)ps.GetComponent(PropLoader);
            _lookaheadWindow = ps.GetInt(PropLookaheadWindow);
            _lookaheadWeight = ps.GetFloat(PropLookaheadPenaltyWeight);
            if (_lookaheadWindow < 1 || _lookaheadWindow > 10)
            {
                throw new PropertyException(typeof(WordPruningBreadthFirstLookaheadSearchManager).Name, PropLookaheadWindow,
                                            "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);
            }
        }
Ejemplo n.º 14
0
 /*
  * (non-Javadoc)
  * @see
  * edu.cmu.sphinx.util.props.Configurable#newProperties(edu.cmu.sphinx.
  * util.props.PropertySheet)
  */
 public override void NewProperties(PropertySheet ps)
 {
     Location                  = ConfigurationManagerUtils.GetResource(PropLocation, ps);
     NgramLogFile              = ps.GetString(PropQueryLogFile);
     NgramCacheSize            = ps.GetInt(PropNgramCacheSize);
     ClearCacheAfterUtterance  = ps.GetBoolean(PropClearCachesAfterUtterance);
     MaxDepth                  = ps.GetInt(PropMaxDepth);
     Dictionary                = (IDictionary)ps.GetComponent(PropDictionary);
     ApplyLanguageWeightAndWip = ps.GetBoolean(PropApplyLanguageWeightAndWip);
     LanguageWeight            = ps.GetFloat(PropLanguageWeight);
     Wip           = ps.GetDouble(PropWordInsertionProbability);
     UnigramWeight = ps.GetFloat(PropUnigramWeight);
     FullSmear     = ps.GetBoolean(PropFullSmear);
 }
Ejemplo n.º 15
0
 public override void NewProperties(PropertySheet ps)
 {
     logMath                   = LogMath.GetLogMath();
     location                  = ConfigurationManagerUtils.GetResource(PropLocation, ps);
     ngramLogFile              = ps.GetString(PROP_QUERY_LOG_FILE);
     MaxDepth                  = ps.GetInt(LanguageModel.PropMaxDepth);
     ngramCacheSize            = ps.GetInt(PROP_NGRAM_CACHE_SIZE);
     clearCacheAfterUtterance  = ps.GetBoolean(PROP_CLEAR_CACHES_AFTER_UTTERANCE);
     dictionary                = (IDictionary)ps.GetComponent(PropDictionary);
     applyLanguageWeightAndWip = ps.GetBoolean(PROP_APPLY_LANGUAGE_WEIGHT_AND_WIP);
     languageWeight            = ps.GetFloat(PROP_LANGUAGE_WEIGHT);
     logWip        = logMath.LinearToLog(ps.GetDouble(PROP_WORD_INSERTION_PROBABILITY));
     unigramWeight = ps.GetFloat(PropUnigramWeight);
 }
Ejemplo n.º 16
0
 public override void NewProperties(PropertySheet ps)
 {
     base.NewProperties(ps);
     Loader = (ILoader)ps.GetComponent(PropLoader);
     try
     {
         Loader.Load();
     }
     catch (IOException e)
     {
         throw new PropertyException(e);
     }
     InitDataProcessors();
 }
Ejemplo n.º 17
0
        public override void NewProperties(PropertySheet ps)
        {
            AcousticModel      = (AcousticModel)ps.GetComponent(PropAcousticModel);
            PhoneInsertionProb = LogMath.GetLogMath().LinearToLog(ps.GetFloat(PropPip));

            UseContextDependentPhones = ps.GetBoolean(PropCD);
            if (UseContextDependentPhones)
            {
                CreateContextDependentSuccessors();
            }
            else
            {
                CreateContextIndependentSuccessors();
            }
        }
Ejemplo n.º 18
0
        /*
         * (non-Javadoc)
         *
         * @see edu.cmu.sphinx.util.props.Configurable#newProperties(edu.cmu.sphinx.util.props.PropertySheet)
         */
        public override void NewProperties(PropertySheet ps)
        {
            base.NewProperties(ps);
            InitRecognizer((Recognizer)ps.GetComponent(PropRecognizer));

            _showSummary        = ps.GetBoolean(PropShowSummary);
            _showDetails        = ps.GetBoolean(PropShowDetails);
            _showResults        = ps.GetBoolean(PropShowResults);
            _showAlignedResults = ps.GetBoolean(PropShowAlignedResults);

            _showRaw = ps.GetBoolean(PropShowRawResults);

            Aligner.SetShowResults(_showResults);
            Aligner.SetShowAlignedResults(_showAlignedResults);
        }
Ejemplo n.º 19
0
        public override void NewProperties(PropertySheet ps)
        {
            _logMath = LogMath.GetLogMath();

            if (_allocated)
            {
                throw new RuntimeException("Can't change properties after allocation");
            }

            _urlLocation     = ConfigurationManagerUtils.GetResource(PropLocation, ps);
            _unigramWeight   = ps.GetFloat(PropUnigramWeight);
            _desiredMaxDepth = ps.GetInt(PropMaxDepth);
            _dictionary      = (IDictionary)ps.GetComponent(PropDictionary);
            _map             = new HashMap <WordSequence, Probability>();
            _vocabulary      = new HashSet <String>();
            _tokens          = new LinkedList <WordSequence>();
        }
Ejemplo n.º 20
0
        /*
         * /// (non-Javadoc)
         *
         * /// @see edu.cmu.sphinx.util.props.Configurable#newProperties(edu.cmu.sphinx.util.props.PropertySheet)
         */
        public void NewProperties(PropertySheet ps)
        {
            cm = ConfigurationManagerUtils.GetPropertyManager(ps);

            skip        = ps.GetInt(PROP_SKIP);
            utteranceId = ps.GetInt(PROP_COUNT);
            if (utteranceId <= 0)
            {
                utteranceId = Integer.MAX_VALUE;
            }

            whichBatch            = ps.GetInt(PROP_WHICH_BATCH);
            totalBatches          = ps.GetInt(PROP_TOTAL_BATCHES);
            usePooledBatchManager = ps.GetBoolean(PROP_USE_POOLED_BATCH_MANAGER);

            recognizer          = (Recognizer)ps.GetComponent(PROP_RECOGNIZER);
            inputDataProcessors = ps.GetComponentList <IDataProcessor>(PROP_INPUT_DATA_PROCESSORS);
        }
Ejemplo n.º 21
0
 public void NewProperties(PropertySheet ps)
 {
     _activeListProvider = (SimpleBreadthFirstSearchManager)ps.GetComponent(ActiveListProvider);
     this.LogInfo("no active list set.");
 }
Ejemplo n.º 22
0
 public void NewProperties(PropertySheet ps)
 {
     dataProc = (DummyProcessor)ps.GetComponent(PROP_DATA_PROC);
     myString = ps.GetString(PROP_ASTRING);
     gamma    = ps.GetDouble(PROP_GAMMA);
 }
Ejemplo n.º 23
0
 public override void NewProperties(PropertySheet ps)
 {
     base.NewProperties(ps);
     Init((ILoader)ps.GetComponent(PropLoader));
 }
Ejemplo n.º 24
0
 public override void NewProperties(PropertySheet ps)
 {
     _dictionary    = (IDictionary)ps.GetComponent(PropDictionary);
     MaxDepth       = ps.GetInt(PropMaxDepth);
     _unigramWeight = ps.GetFloat(PropUnigramWeight);
 }
 public override void NewProperties(PropertySheet ps)
 {
     Loader         = (ILoader)ps.GetComponent(PropLoader);
     UnitManager    = (UnitManager)ps.GetComponent(PropUnitManager);
     _useComposites = ps.GetBoolean(PropUseComposites);
 }
Ejemplo n.º 26
0
 public virtual void NewProperties(PropertySheet ps)
 {
     Init(ps.GetInstanceName(), (ISearchManager)ps.GetComponent(PropSearchManager), ps.GetBoolean(FireNonFinalResults), ps.GetBoolean(AutoAllocate), ps.GetComponentList <IResultListener>(PropResultListeners));
 }
Ejemplo n.º 27
0
        public override void NewProperties(PropertySheet ps)
        {
            base.NewProperties(ps);

            Classifier = (AbstractVoiceActivityDetector)ps.GetComponent(PropClassifier);
        }
Ejemplo n.º 28
0
 public void NewProperties(PropertySheet ps)
 {
     InitRecognizer((Recognizer)ps.GetComponent(PropRecognizer));
     _allocatedMonitors   = ps.GetComponentList <IRunnable>(PropAllocatedMonitors);
     _deallocatedMonitors = ps.GetComponentList <IRunnable>(PropDeallocatedMonitors);
 }
 public void NewProperties(PropertySheet ps)
 {
     _dataProc = (DummyProcessor)ps.GetComponent(PropDataProc);
 }
Ejemplo n.º 30
0
 public void NewProperties(PropertySheet ps)
 {
     init(ps.GetString(PROP_LOCATION), (UnitManager)ps.GetComponent(PROP_UNIT_MANAGER));
 }