File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 13
13
#import < RegexKitLite/RegexKitLite.h>
14
14
#import " AvroParser.h"
15
15
#import " AutoCorrect.h"
16
- #import " TolerantDecoder.h"
17
16
#import " RomanNormalizer.h"
18
17
19
18
@implementation AvroKeyboardController
@@ -63,7 +62,14 @@ - (void)findCurrentCandidates {
63
62
CFAbsoluteTime t0 = CFAbsoluteTimeGetCurrent ();
64
63
NSString *norm = [RomanNormalizer normalize: termForLookup];
65
64
// Choose best tolerant correction (includes original)
66
- NSString *best = [TolerantDecoder bestFor: norm];
65
+ Class decClass = NSClassFromString (@" TolerantDecoder" );
66
+ NSString *best = norm;
67
+ if (decClass && [decClass respondsToSelector: @selector (bestFor: )]) {
68
+ #pragma clang diagnostic push
69
+ #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
70
+ best = [decClass performSelector: @selector (bestFor: ) withObject: norm];
71
+ #pragma clang diagnostic pop
72
+ }
67
73
// Optionally, merge original+best lookups for broader suggestions
68
74
if ([best isEqualToString: norm]) {
69
75
termForLookup = best;
You can’t perform that action at this time.
0 commit comments