objective c - ObjC / iPhone dictionary grep? -
i have large number of strings in iphone app containing random combinations of letters, , i'd check each of these random strings against dictionary. i'm looking way grep each string /usr/share/dict/words , return result (or number of results) app. possible in iphone app?
edit: suggestions. wanted execute grep , ideally pipe results app, after more digging , playing around nstask seems not possible on iphone. ended loading words big nsdictionary approach:
nsstring* allwords = [nsstring stringwithcontentsoffile:@"/usr/share/dict/words" encoding:nsasciistringencoding error:null]; nsarray* wordarray = [allwords componentsseparatedbystring:@"\n"];
easiest way add words sqlite database , grep against them using sql query or nspredicate
Comments
Post a Comment