【问题标题】:Spell check with google dictionary [closed]使用谷歌词典进行拼写检查[关闭]
【发布时间】:2014-11-01 07:47:44
【问题描述】:
我正在创建一个应用程序,我必须在其中检查用户输入的单词是否正确或不使用 Google 词典。如果用户输入的单词是正确的,则会显示一个 toast。我的谷歌搜索没有得到任何合适的解决方案。所以如果可能的话,请给我一些想法。
【问题讨论】:
标签:
android-layout
dictionary
android
android-toast
【解决方案1】:
@Override
public void onGetSuggestions(final SuggestionsInfo[] arg0) {
isSpellCorrect = false;
final StringBuilder sb = new StringBuilder();
for (int i = 0; i < arg0.length; ++i) {
// Returned suggestions are contained in SuggestionsInfo
final int len = arg0[i].getSuggestionsCount();
if(editText1.getText().toString().equalsIgnoreCase(arg0[i].getSuggestionAt(j))
{
isSpellCorrect = true;
break;
}
}
}
您可以从这个link 找到整个项目。在上面的项目中,您可以看到附加了字符串。相反,只需更改上述方法 onGetSuggestions..