您可以查看有关 LanguageModelGenerator 的更多详细信息,并将您的问题发布到politepix.com/openears/
不过我要回答。
是的。你说的对。
从他们的网站信息中,在您要创建语言模型的方法中,添加以下方法调用
它将在您的文档目录中生成新的语言模型文件(它将覆盖旧文件)
NSArray *words = [NSArray arrayWithObjects:@"YOUR FIRST SENTENCE", @"YOUR SECOND SENTENCE", @"YOUR THIRD SENTENCE", nil];
NSString *name = @"NameIWantForMyLanguageModelFiles";
NSError *err = [lmGenerator generateLanguageModelFromArray:words withFilesNamed:name];
NSDictionary *languageGeneratorResults = nil;
NSString *lmPath = nil;
NSString *dicPath = nil;
if([err code] == noErr) {
languageGeneratorResults = [err userInfo];
lmPath = [languageGeneratorResults objectForKey:@"LMPath"];
dicPath = [languageGeneratorResults objectForKey:@"DictionaryPath"];
} else {
NSLog(@"Error: %@",[err localizedDescription]);
}