Created
June 18, 2014 09:58
-
-
Save dongyuwei/8a7618288c9f37db459c to your computer and use it in GitHub Desktop.
test NSSpellChecker, show suggestion list for an uncorrect word.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <AppKit/NSSpellChecker.h> //import AppKit framework | |
void testSpellCheck(){ | |
NSSpellChecker* checker = [NSSpellChecker sharedSpellChecker]; | |
NSString * string = @"helo"; | |
NSRange range = NSMakeRange(0, [string length]); | |
NSArray *corrected = [checker guessesForWordRange:range inString:string language:@"en" inSpellDocumentWithTag:0]; | |
NSLog(@"NSSpellChecker suggestion:%@",corrected); | |
} |
Author
dongyuwei
commented
Jun 24, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment