I am writing an iPhone app with a simple shift as a pet project, and one part of the functionality I'm currently developing is the “universal” NSString decryption, which returns NSArray, all NSStrings:
- (NSArray*) decryptString: (NSString*)ciphertext{
NSMutableArray* theDecryptions = [NSMutableArray arrayWithCapacity:ALPHABET];
for (int i = 0; i < ALPHABET; ++i) {
NSString* theNewPlainText = [self decryptString:ciphertext ForShift:i];
[theDecryptions insertObject:theNewPlainText
atIndex:i];
}
return theDecryptions;
}
I would really like to pass this NSArray to another method, which tries to check each individual row in the array and creates a new array that puts the rows with the least number of typo'd words at lower rates, first displayed. I would like to use the system dictionary as a text field, so I can match the words that were trained on the phone by its user.
, , NSSpellChecker -checkSpellingOfString:StartingAt: . , ?