【问题标题】:Google dictionary Spelling check in android?android中的谷歌字典拼写检查?
【发布时间】:2014-10-30 11:30:08
【问题描述】:

如何在android中使用Google dictionary检查拼写?

我想知道我输入的单词是否正确。
它应该从Google dictionary检查。
如果单词正确,则应显示在 toast 中,否则不应显示

【问题讨论】:

    标签: android android-layout dictionary toast android-toast


    【解决方案1】:
    @Override
       public void onGetSuggestions(final SuggestionsInfo[] arg0) {
          final StringBuilder sb = new StringBuilder();
         boolean isSpellCorrect = false;
          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(i)))
             {
                 isSpellCorrect = true;
                 Toast.makeText(this, "Entered word is correct", Toast.LENGTH_LONG).show();
                 break;
             }
          }
       }
    

    在整个项目中使用这个link,只需在上述方法中进行更改即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-11-01
      • 2013-09-21
      • 2013-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多