// // FooSpellCheck.h // euspell // // Created by MH on 11/6/11. // Copyright 2011 __MyCompanyName__. All rights reserved. // // Apache License // Version 2.0, January 2004 // http://www.apache.org/licenses/ #import #import #include "/usr/local/include/fomalib.h" #include int utf8skip(char *str); @interface FooSpellCheckClass : NSObject { NSArray *wordsAray; struct fsm *spell_fsm; struct fsm *grammar_fsm; struct apply_handle *spell_apply_handle; struct apply_handle *grammar_apply_handle; struct apply_med_handle *spell_apply_med_handle; } - (id )init; - (void) dealloc; // New method: Search for a misspelled word in a given string - (NSArray *)spellServer:(NSSpellServer *)sender checkString:(NSString *)stringToCheck offset:(NSUInteger)offset types:(NSTextCheckingTypes) checkingTypes options:(NSDictionary *)options orthography: (NSOrthography *)orthography wordCount:(NSInteger *)wordCount; // Old method: Search for a misspelled word in a given string /* - (NSRange)spellServer:(NSSpellServer *)sender findMisspelledWordInString:(NSString *)stringToCheck language: (NSString *)language wordCount:(NSInteger *)wordCount countOnly:(BOOL) countOnly; */ - (NSArray *)spellServer:(NSSpellServer *)sender suggestCompletionsForPartialWordRange:(NSRange)range inString: (NSString *)string language:(NSString *)language; - (NSArray *)spellServer:(NSSpellServer *)sender suggestGuessesForWord: (NSString *)word inLanguage:(NSString *)language; - (void)spellServer:(NSSpellServer *)sender didLearnWord:(NSString *) word inLanguage:(NSString *)language; - (void)spellServer:(NSSpellServer *)sender didForgetWord:(NSString *) word inLanguage:(NSString *)language; - (BOOL)isWordCorrect:(NSString *)word; - (NSRange)spellServer:(NSSpellServer *)sender checkGrammarInString: (NSString *)string language:(NSString *)language details:(NSArray **) outDetails; @end