Home › Forums › OpenEars plugins › May Need Previous Version of Rejecto
- This topic has 16 replies, 2 voices, and was last updated 10 years, 5 months ago by Halle Winkler.
-
AuthorPosts
-
November 19, 2013 at 5:52 pm #1018936LannParticipant
Hello,
I just purchased Rejecto and I am having some linker issues. I believe that I need the previous version of Rejecto for my project. In my case, it would be preferable to use the older Rejecto rather than upgrading OpenEars.
Here is the linker error I am getting which does not occur when I use the older RejectoDemo.framework:
Undefined symbols for architecture i386:
“_OBJC_CLASS_$_SScribe”, referenced from:
objc-class-ref in Rejecto(LanguageModelGenerator+Rejecto.o)
ld: symbol(s) not found for architecture i386November 19, 2013 at 6:02 pm #1018937Halle WinklerPolitepixWelcome Lann,
I completely understand the drive behind the request and I’m sorry since I can’t distribute out-of-date versions. It would be extremely arduous to give any support for since it requires the entire test rig of that era (the OpenEars version, any other plugins, possibly Xcode versions if OS versions were involved with the upgrade) and your account would require special handling every time there was an update. But I’ll be happy to assist you here to get up to the current version of OpenEars; just let me know any issues you’re encountering.
November 19, 2013 at 6:27 pm #1018938LannParticipantThanks for the quick response. Oddly, the linker error persists even if I use the latest OpenEars. I also get an extra one, just for fun:
Undefined symbols for architecture i386:
“_OBJC_CLASS_$_SScribe”, referenced from:
objc-class-ref in Rejecto(LanguageModelGenerator+Rejecto.o)
“_returner”, referenced from:
-[LanguageModelGenerator(Rejecto) generateRejectingLanguageModelFromArray:withFilesNamed:withOptionalExclusions:usingVowelsOnly:withWeight:forAcousticModelAtPath:] in Rejecto(LanguageModelGenerator+Rejecto.o)
ld: symbol(s) not found for architecture i386November 19, 2013 at 6:34 pm #1018939LannParticipantScratch that last one. It was my own mistake. Now it compiles and links but the whole issue here is that I’m using an older version of an Apache Cordoba/PhoneGap plugin for openears and now I get the following error which did not previously occur:
-[LanguageModelGenerator generateRejectingLanguageModelFromArray:withFilesNamed:withOptionalExclusions:usingVowelsOnly:withWeight:]: unrecognized selector sent to instance 0x8330280
*** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInvalidArgumentException> -[LanguageModelGenerator generateRejectingLanguageModelFromArray:withFilesNamed:withOptionalExclusions:usingVowelsOnly:withWeight:]: unrecognized selector sent to instance 0x8330280
November 19, 2013 at 6:44 pm #1018940Halle WinklerPolitepixOh, great to hear (I had just written up a big troubleshooting process for you but it sounds like you’re OK as far as the framework). The issue above is just because OpenEars and Rejecto had an API change in order to support multiple languages, with the addition of an AcousticModel object whose path needs to be passed to LanguageModelGenerator and PocketsphinxController methods now. Just take a look at the replacement for the complaining method above that is in the header file or PDF. The tutorial also uses the current API so it might be worth a look.
November 19, 2013 at 7:32 pm #1018941LannParticipantI am still having a bit of trouble converting the following snippet:
-(void)languageModelGeneratorGenerateLanguageModelFromArray:(NSArray *)arguments withDict:(NSDictionary *)options{
NSString *languageArrayCSV = [arguments objectAtIndex:0];
NSArray *languageArray = [languageArrayCSV componentsSeparatedByString:@”,”];NSError *error = [self.language_model_generator generateRejectingLanguageModelFromArray:languageArray withFilesNamed:@”dynamic”withOptionalExclusions:nil
usingVowelsOnly:FALSE
withWeight:nil];I am trying:
NSError *error = [self.language_model_generator generateRejectingLanguageModelFromArray:languageArray
withFilesNamed:@”dynamic”
withOptionalExclusions:nil
usingVowelsOnly:FALSE
withWeight:nil
// Change “AcousticModelEnglish” to “AcousticModelSpanish” to create a Spanish Rejecto model.
forAcousticModelAtPath:[AcousticModel pathToModel:@”AcousticModelEnglish”]];But I get an error that AcousticModel is undefined
November 19, 2013 at 7:46 pm #1018943LannParticipantWell, I seem to have gotten past the above issue and now i’m at:
Error: the default phonetic dictionary (null) can’t be found in the app bundle but the app is attempting to access it, most likely there will be a crash now.
November 19, 2013 at 7:49 pm #1018944Halle WinklerPolitepixProgress, progress :) . Is it possible that you haven’t added the acoustic model bundle itself to your app so that it is available at the root of mainBundle?
November 19, 2013 at 8:03 pm #1018945LannParticipantI have AcousticModelEnglish.bundle in the root of my Resources folder in xcode. What else could this be?
November 19, 2013 at 8:07 pm #1018946Halle WinklerPolitepixThe important question is about whether it is found in the root level of your app and whether all of its files are within. You can verify this by going to your Products folder, right-clicking on the built app, choosing “Show In Finder”, and then right-clicking on the .app file and selecting “Show Package Contents”. You should then see all the items at the root level of your app, and the acoustic model bundle should be there. If you look inside it, it should have the same files within as it does in the distribution.
November 19, 2013 at 8:16 pm #1018947LannParticipantThe bundle is making it to the product so it’s not that. I am somewhat stumped now. Here are the functions from my plugin which call the updated code
/*
* ++++++++++++++++++++++++++++++++++++++++
* LanguageModelGenerator methods
* ++++++++++++++++++++++++++++++++++++++++
*/
-(void)languageModelGeneratorGenerateLanguageModelFromArray:(NSArray *)arguments withDict:(NSDictionary *)options{NSString *languageArrayCSV = [arguments objectAtIndex:0];
NSArray *languageArray = [languageArrayCSV componentsSeparatedByString:@”,”];/*NSError *error = [self.language_model_generator generateRejectingLanguageModelFromArray:languageArray withFilesNamed:@”dynamic”withOptionalExclusions:nil
usingVowelsOnly:FALSE
withWeight:nil];*/NSError *error = [self.language_model_generator generateRejectingLanguageModelFromArray:languageArray
withFilesNamed:@”dynamic”
withOptionalExclusions:nil
usingVowelsOnly:FALSE
withWeight:nil
// Change “AcousticModelEnglish” to “AcousticModelSpanish” to create a Spanish Rejecto model.
forAcousticModelAtPath:[self.current_language_model pathToModel:@”AcousticModelEnglish”]];NSDictionary *dynamicLanguageGenerationResultsDictionary = nil;
if([error code] != noErr) {
NSLog(@”Dynamic language generator reported error %@”, [error description]);
} else {
dynamicLanguageGenerationResultsDictionary = [error userInfo];NSString *lmFile = [dynamicLanguageGenerationResultsDictionary objectForKey:@”LMFile”];
NSString *dictionaryFile = [dynamicLanguageGenerationResultsDictionary objectForKey:@”DictionaryFile”];
NSString *lmPath = [dynamicLanguageGenerationResultsDictionary objectForKey:@”LMPath”];
NSString *dictionaryPath = [dynamicLanguageGenerationResultsDictionary objectForKey:@”DictionaryPath”];NSLog(@”Dynamic language generator completed successfully, you can find your new files %@\n and \n%@\n at the paths \n%@ \nand \n%@”, lmFile,dictionaryFile,lmPath,dictionaryPath);
self.path_to_dynamic_language_model = lmPath;
self.path_to_dynamic_grammar = dictionaryPath;}
//[languageArray release];
if(dynamicLanguageGenerationResultsDictionary){
NSLog(@”LANGUAGE MODEL PATH: %@”,self.path_to_dynamic_language_model);
NSLog(@”DYNAMIC GRAMMAR PATH: %@”,self.path_to_dynamic_grammar);switch ([self.started_listening intValue]) {
// Pocketsphinx is listening, switch to new language model
case 1:
NSLog(@”***Switching to new lm.”);
[self.pocket_sphinx_controller changeLanguageModelToFile:self.path_to_dynamic_language_model withDictionary:self.path_to_dynamic_grammar];
break;// Otherwise, start listening with language model
default:
NSLog(@”***Starting with new lm.”);
//[self.pocket_sphinx_controller startListeningWithLanguageModelAtPath:self.path_to_dynamic_language_model dictionaryAtPath:self.path_to_dynamic_grammar languageModelIsJSGF:NO];
[self.pocket_sphinx_controller startListeningWithLanguageModelAtPath:self.path_to_dynamic_language_model dictionaryAtPath:self.path_to_dynamic_grammar acousticModelAtPath:[self.current_language_model pathToModel:@”AcousticModelEnglish”] languageModelIsJSGF:NO]; // Change “AcousticModelEnglish” to “AcousticModelSpanish” to perform Spanish recognition instead of English.
break;
}}
}
/*
* ++++++++++++++++++++++++++++++++++++++++
* LanguageModelGenerator methods
* ++++++++++++++++++++++++++++++++++++++++
*/
-(void)languageModelGeneratorGenerateLanguageModelFromArray:(NSArray *)arguments withDict:(NSDictionary *)options{NSString *languageArrayCSV = [arguments objectAtIndex:0];
NSArray *languageArray = [languageArrayCSV componentsSeparatedByString:@”,”];/*NSError *error = [self.language_model_generator generateRejectingLanguageModelFromArray:languageArray withFilesNamed:@”dynamic”withOptionalExclusions:nil
usingVowelsOnly:FALSE
withWeight:nil];*/NSError *error = [self.language_model_generator generateRejectingLanguageModelFromArray:languageArray
withFilesNamed:@”dynamic”
withOptionalExclusions:nil
usingVowelsOnly:FALSE
withWeight:nil
// Change “AcousticModelEnglish” to “AcousticModelSpanish” to create a Spanish Rejecto model.
forAcousticModelAtPath:[self.current_language_model pathToModel:@”AcousticModelEnglish”]];NSDictionary *dynamicLanguageGenerationResultsDictionary = nil;
if([error code] != noErr) {
NSLog(@”Dynamic language generator reported error %@”, [error description]);
} else {
dynamicLanguageGenerationResultsDictionary = [error userInfo];NSString *lmFile = [dynamicLanguageGenerationResultsDictionary objectForKey:@”LMFile”];
NSString *dictionaryFile = [dynamicLanguageGenerationResultsDictionary objectForKey:@”DictionaryFile”];
NSString *lmPath = [dynamicLanguageGenerationResultsDictionary objectForKey:@”LMPath”];
NSString *dictionaryPath = [dynamicLanguageGenerationResultsDictionary objectForKey:@”DictionaryPath”];NSLog(@”Dynamic language generator completed successfully, you can find your new files %@\n and \n%@\n at the paths \n%@ \nand \n%@”, lmFile,dictionaryFile,lmPath,dictionaryPath);
self.path_to_dynamic_language_model = lmPath;
self.path_to_dynamic_grammar = dictionaryPath;}
//[languageArray release];
if(dynamicLanguageGenerationResultsDictionary){
NSLog(@”LANGUAGE MODEL PATH: %@”,self.path_to_dynamic_language_model);
NSLog(@”DYNAMIC GRAMMAR PATH: %@”,self.path_to_dynamic_grammar);switch ([self.started_listening intValue]) {
// Pocketsphinx is listening, switch to new language model
case 1:
NSLog(@”***Switching to new lm.”);
[self.pocket_sphinx_controller changeLanguageModelToFile:self.path_to_dynamic_language_model withDictionary:self.path_to_dynamic_grammar];
break;// Otherwise, start listening with language model
default:
NSLog(@”***Starting with new lm.”);
//[self.pocket_sphinx_controller startListeningWithLanguageModelAtPath:self.path_to_dynamic_language_model dictionaryAtPath:self.path_to_dynamic_grammar languageModelIsJSGF:NO];
[self.pocket_sphinx_controller startListeningWithLanguageModelAtPath:self.path_to_dynamic_language_model dictionaryAtPath:self.path_to_dynamic_grammar acousticModelAtPath:[self.current_language_model pathToModel:@”AcousticModelEnglish”] languageModelIsJSGF:NO]; // Change “AcousticModelEnglish” to “AcousticModelSpanish” to perform Spanish recognition instead of English.
break;
}}
}
November 19, 2013 at 8:17 pm #1018948LannParticipantHere is the full error that I’m receiving:
Error while trying to load the pronunciation dictionary: Error Domain=NSCocoaErrorDomain Code=260 “The operation couldn’t be completed. (Cocoa error 260.)” UserInfo=0x83480d0 {NSFilePath=(null)/LanguageModelGeneratorLookupList.text, NSUnderlyingError=0x835c9b0 “The operation couldn’t be completed. No such file or directory”}
November 19, 2013 at 8:41 pm #1018949Halle WinklerPolitepixI think this is not a path to an acoustic model and also that it is null when it is passed: [self.current_language_model pathToModel:@”AcousticModelEnglish”]]; Take a look at the tutorial for an example of a path to the acoustic model.
November 20, 2013 at 7:30 am #1018953LannParticipantI am still quite stumped at the moment. Maybe you could take a look at the code I am basing all of this on here:
https://github.com/rtelep/phonegap_openears/blob/master/openEarsPlugin.mm
Does the issue have something to do with self.current_language_model being an NSString?
November 20, 2013 at 9:13 am #1018955Halle WinklerPolitepixGive it a try using the version from the tutorial/docs:
[AcousticModel pathToModel:@”AcousticModelEnglish”]
November 20, 2013 at 10:03 am #1018956LannParticipantAaaand it works! Thank you so much for your help. The issue was that I forgot to include
#import <OpenEars/AcousticModel.h>
November 20, 2013 at 10:20 am #1018957Halle WinklerPolitepixThat’s great! You’re welcome.
-
AuthorPosts
- You must be logged in to reply to this topic.