rangeOfMisspelledWordInString find random letters as valid word

后端 未结 2 833
迷失自我
迷失自我 2020-12-22 05:53

Can anybody duplicate this result? I\'m testing rangeOfMisspelledWordInString (in iOS) to find mispelled words and some random letters return a va

2条回答
  •  暖寄归人
    2020-12-22 06:47

    I think "the" and "thy" just might be valid words ;)

    Other than that, my best guess is that the text system can't provide a guess for the word, and so ignores it entirely - the semantic meaning of "misspelled word" might not include "strings of letters which cannot conceivably be a misspelling of a word." I notice that when I type those strings into a system text field (e.g. in Messages), I don't get any replacement suggestions.

    You could also make sure that your UITextChecker instance isn't set to ignore those particular words; take a look at the ignoredWords property.

提交回复
热议问题