android spellchecker not working for large text

时间:2015-11-12 10:50:20

标签: android spell-checking

hi i want to develop an application which gets user text and says which words are incorrect when user writes his text i want to show a list for example something like this . peeple->people after searching i found that we have something called SpellCheckerSessionListener but it doesn't work on large text and doesn't say which word was incorrect. what do you suggest what i do now is get the user text divide it into a list of words and call

    scs.getSuggestions(new TextInfo[]{new TextInfo(params[0])}, 3, true);

the rest of code is below

@Override
    public void onGetSuggestions(final SuggestionsInfo[] arg0) {
        final StringBuilder sb = new StringBuilder();
        if (arg0.length != 0) {
            had=true;
            for (int i = 0; i < arg0.length; ++i) {
                final int len = arg0[i].getSuggestionsCount();
                sb.append('\n');
                for (int j = 0; j < len; ++j) {
                    sb.append(arg0[i].getSuggestionAt(j) + " ");
                }
            }
            tv.setText(tv.getText().toString() + "\n" + sb.toString());
        }
    }

0 个答案:

没有答案