Home › Forums › OpenEars › Question about using a custom dictionary › Reply To: Question about using a custom dictionary
Yup, thank you for giving me the heads-up about how out-of-date that post is – I will put it on the list for revision when there is time.
I removed dictionaryPathAsString when OpenEars became bilingual because it threatened to heavily complicate the new acoustic model bundle code and my sense was that the method wasn’t being used (which I think was probably the correct call since this is to the best of my knowledge the first time I’ve been asked about using it since it was removed). However, it is still possible to use your own lookup dictionary by using the standard method.
If you take a look at the generation method:
- (NSError *) generateLanguageModelFromArray:(NSArray *)languageModelArray withFilesNamed:(NSString *)fileName forAcousticModelAtPath:(NSString *)acousticModelPath;
It takes a path to an acoustic model. The only thing it does with this path is find LanguageModelGeneratorLookupList.text inside of an acoustic model bundle – LanguageModelGenerator doesn’t make use of any of the other items in the acoustic model bundles. So if you want to use a custom lookup dictionary that you can also write to as described in that blog post, you only have to make your own acoustic model bundle that has nothing in it but your LanguageModelGeneratorLookupList.text and have it in a writable location (such as Caches or Documents). As long as the lookup dictionary follows the same rules as the one in the acoustic model you’re going to use for your listening session (i.e. uses exactly the same formatting and the same phonemes, is alphabetized, etc) it will work fine.
Here is where to read about making your own acoustic model, although all you need in the bundle in this case is your LanguageModelGeneratorLookupList.text:
You may end up needing to do a bit of troubleshooting making sure that the right path gets passed in the end – just ask for more help with specifics if you need it later.