Пример #1
0
        private void generateStartStopLanguageModel(OELanguageModelGenerator gen)
        {
            string[] langArray         = { "GO", "STOP" };
            string   acousticModelPath = OEAcousticModel.PathToModel("AcousticModelEnglish");

            NSError error = gen.GenerateLanguageModelFromArray(langArray, startStopLanguageModelName, acousticModelPath);

            if (error != null)
            {
                Console.WriteLine("Dynamic language generator reported error {0}", error.Description);
            }
            else
            {
                pathToStartStopLanguageModel = gen.PathToSuccessfullyGeneratedLanguageModelWithRequestedName(startStopLanguageModelName);
                pathToStartStopDictionary    = gen.PathToSuccessfullyGeneratedDictionaryWithRequestedName(startStopLanguageModelName);
            }
        }
Пример #2
0
        private void generateDigitLanguageModel(OELanguageModelGenerator gen)
        {
            string[] langArray = { "0",  "1",  "2",  "3",  "4",  "5",  "6",  "7",  "8",  "9",
                                   "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
                                   "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30" };
            string   acousticModelPath = OEAcousticModel.PathToModel("AcousticModelEnglish");

            NSError error = gen.GenerateLanguageModelFromArray(langArray, digitLanguageModelName, acousticModelPath);

            if (error != null)
            {
                Console.WriteLine("Dynamic language generator reported error {0}", error.Description);
            }
            else
            {
                pathToDigitLanguageModel = gen.PathToSuccessfullyGeneratedLanguageModelWithRequestedName(digitLanguageModelName);
                pathToDigitDictionary    = gen.PathToSuccessfullyGeneratedDictionaryWithRequestedName(digitLanguageModelName);
            }
        }