[libvoikko] VoikkoSpellService (MacOS X) with alternative backend
    Sjur Moshagen 
    sjurnm at mac.com
       
    Thu Apr 29 10:51:04 EEST 2010
    
    
  
Hello,
Now that I got the hfst backend to work, it would also be very nice to have the VoikkoSpellService for MacOS X (system-wide spellng service) use the hfst backend. Since the hfst backend is compiled into libvoikko, I assume it is just some parameter somewhere to tell libvoikko to use the alternative backend.
Would an extra argument to the voikko_init function be appropriate? Presently the init call looks like:
int main(int argc, char **argv) {
	char dictpath[1024], *p;
	strcpy(dictpath, argv[0]);
	if(p = strrchr(dictpath, '/')) {
		*p = '\0';
	}
	strcat(dictpath, "/../Resources/voikko");
	if (voikko_init_with_path(&voikko_handle, "fi_FI", 0, dictpath)) {
		fprintf(stderr, "voikko_init_with_path failed (path = %s)\n", dictpath);
		exit(1);
	}
...
}
(this code is slightly changed from trunk, it is based on the diff that is part of http://www.nbl.fi/~nbl3392/voikko/mac/VoikkoSpellService_2009.dmg)
I tried to replace "fi_FI" with "fi-x-hfst" above (and added the lexicon files in what I think is the proper location), but that caused the following error:
29.04.10 10.46.20	[0x0-0x18ec8eb].org.puimula.VoikkoSpellService[49609]	voikko_init_with_path failed (path = /Users/sjur/Library/Services/VoikkoSpellService.app/Contents/MacOS/../Resources/voikko)
29.04.10 10.46.20	com.apple.launchd.peruser.502[235]	([0x0-0x18ec8eb].org.puimula.VoikkoSpellService[49609]) Exited with exit code: 1
Ideas?
Sjur
    
    
More information about the Libvoikko
mailing list