say, have vocabulary (around 100000 words) , word ("inputstring"). so:
i need generate words "inputstring" "input", "string", "put", "strinpg" etc. , need check out them in vocabulary. algorithm that? because have idea with:
- recursive search possible combinations @ step 1
- using
nspredicatesfilter them in vocabulary.
you're on right track nspredicate. , phase you're looking fault tolerant search , solved levenshtein distance. need make || combination queries in single queries.
let's assume have words in nsarray. need call method filteredarrayusingpredicate: on it, it's not super easy build predicate that.
so requirements are:
- search word can part of larger word
- user can misspelled word
first part pretty easy, need put contains predicate. second part should ?tring or s?ring or st?ing... , can build simple for. can experiment various number of ? signs , see matches criteria.
Comments
Post a Comment