【问题标题】:Spell check with google dictionary [closed]使用谷歌词典进行拼写检查[关闭]
【发布时间】:2014-11-01 07:47:44
【问题描述】:

我正在创建一个应用程序,我必须在其中检查用户输入的单词是否正确或不使用 Google 词典。如果用户输入的单词是正确的,则会显示一个 toast。我的谷歌搜索没有得到任何合适的解决方案。所以如果可能的话,请给我一些想法。

【问题讨论】:

  • 请分享您尝试的解决方案。更多信息请阅读how to ask

标签: 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..

【讨论】:

  • 请用代码发布描述..
猜你喜欢
  • 1970-01-01
  • 2014-10-30
  • 1970-01-01
  • 2016-01-22
  • 2013-03-26
  • 2013-04-15
  • 2012-04-18
  • 1970-01-01
  • 2017-06-22
相关资源
最近更新 更多