Beispiel #1
0
        public void Batch_ForcedAlignerGrammar()
        {
            var dictionaryUrl = new URL("cmudict-en-us.dict");
            var noisedictUrl  = new URL("noisedict");

            IDictionary dictionary = new TextDictionary(dictionaryUrl,
                                                        noisedictUrl,
                                                        null,
                                                        null,
                                                        new UnitManager());

            URL url = new URL("BatchForcedAlignerGrammarTest.utts");
            BatchForcedAlignerGrammar grammar;

            grammar = new BatchForcedAlignerGrammar(url.Path,
                                                    true,
                                                    true,
                                                    true,
                                                    true,
                                                    dictionary);
            grammar.Allocate();
            Assert.IsTrue(Helper.IsOneOf(grammar.GetRandomSentence(), "one", "two", "three"));
        }
 public BatchForcedAlignerRecognizer(BatchForcedAlignerGrammar bfaGrammar, Recognizer recognizer, List inputDataProcessors, string ctlFile, string dataDir, string refFile, string ctmFile, int bitsPerSample, int samplesPerSecond, int framesPerSecond, int channelCount) : base(recognizer, inputDataProcessors, ctlFile, dataDir, refFile, ctmFile, bitsPerSample, samplesPerSecond, framesPerSecond, channelCount)
 {
     this.bfaGrammar = bfaGrammar;
 }