This file contains hidden or 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 <Foundation/Foundation.h> | |
| @implementation NSString (JEKNormalization) | |
| - (NSString *)jek_normalizedString | |
| { | |
| __block NSString *normalizedString = self; | |
| [self enumerateLinguisticTagsInRange:NSMakeRange(0, self.length) scheme:NSLinguisticTagSchemeLexicalClass options:~NSLinguisticTaggerOmitWords orthography:nil usingBlock:^(NSString *tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop) { | |
| if (tag == NSLinguisticTagDeterminer && tokenRange.location == 0) { | |
| normalizedString = [self substringFromIndex:tokenRange.length + 1]; |
NewerOlder