Loading java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java +32 −17 Original line number Diff line number Diff line Loading @@ -334,10 +334,19 @@ public class AndroidSpellCheckerService extends SpellCheckerService { final String text = textInfo.getText(); if (shouldFilterOut(text)) { final DictAndProximity dictInfo = mDictionaryPool.takeOrGetNull(); DictAndProximity dictInfo = null; try { dictInfo = mDictionaryPool.takeOrGetNull(); if (null == dictInfo) return NOT_IN_DICT_EMPTY_SUGGESTIONS; return dictInfo.mDictionary.isValidWord(text) ? IN_DICT_EMPTY_SUGGESTIONS : NOT_IN_DICT_EMPTY_SUGGESTIONS; } finally { if (null != dictInfo) { if (!mDictionaryPool.offer(dictInfo)) { Log.e(TAG, "Can't re-insert a dictionary into its pool"); } } } } final SuggestionsGatherer suggestionsGatherer = Loading @@ -361,7 +370,9 @@ public class AndroidSpellCheckerService extends SpellCheckerService { final int capitalizeType = getCapitalizationType(text); boolean isInDict = true; final DictAndProximity dictInfo = mDictionaryPool.takeOrGetNull(); DictAndProximity dictInfo = null; try { dictInfo = mDictionaryPool.takeOrGetNull(); if (null == dictInfo) return NOT_IN_DICT_EMPTY_SUGGESTIONS; dictInfo.mDictionary.getWords(composer, suggestionsGatherer, dictInfo.mProximityInfo); Loading @@ -372,9 +383,13 @@ public class AndroidSpellCheckerService extends SpellCheckerService { // want to test a lowercase version of it. isInDict = dictInfo.mDictionary.isValidWord(text.toLowerCase(mLocale)); } } finally { if (null != dictInfo) { if (!mDictionaryPool.offer(dictInfo)) { Log.e(TAG, "Can't re-insert a dictionary into its pool"); } } } final SuggestionsGatherer.Result result = suggestionsGatherer.getResults(text, mService.mTypoThreshold, capitalizeType, mLocale); Loading Loading
java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java +32 −17 Original line number Diff line number Diff line Loading @@ -334,10 +334,19 @@ public class AndroidSpellCheckerService extends SpellCheckerService { final String text = textInfo.getText(); if (shouldFilterOut(text)) { final DictAndProximity dictInfo = mDictionaryPool.takeOrGetNull(); DictAndProximity dictInfo = null; try { dictInfo = mDictionaryPool.takeOrGetNull(); if (null == dictInfo) return NOT_IN_DICT_EMPTY_SUGGESTIONS; return dictInfo.mDictionary.isValidWord(text) ? IN_DICT_EMPTY_SUGGESTIONS : NOT_IN_DICT_EMPTY_SUGGESTIONS; } finally { if (null != dictInfo) { if (!mDictionaryPool.offer(dictInfo)) { Log.e(TAG, "Can't re-insert a dictionary into its pool"); } } } } final SuggestionsGatherer suggestionsGatherer = Loading @@ -361,7 +370,9 @@ public class AndroidSpellCheckerService extends SpellCheckerService { final int capitalizeType = getCapitalizationType(text); boolean isInDict = true; final DictAndProximity dictInfo = mDictionaryPool.takeOrGetNull(); DictAndProximity dictInfo = null; try { dictInfo = mDictionaryPool.takeOrGetNull(); if (null == dictInfo) return NOT_IN_DICT_EMPTY_SUGGESTIONS; dictInfo.mDictionary.getWords(composer, suggestionsGatherer, dictInfo.mProximityInfo); Loading @@ -372,9 +383,13 @@ public class AndroidSpellCheckerService extends SpellCheckerService { // want to test a lowercase version of it. isInDict = dictInfo.mDictionary.isValidWord(text.toLowerCase(mLocale)); } } finally { if (null != dictInfo) { if (!mDictionaryPool.offer(dictInfo)) { Log.e(TAG, "Can't re-insert a dictionary into its pool"); } } } final SuggestionsGatherer.Result result = suggestionsGatherer.getResults(text, mService.mTypoThreshold, capitalizeType, mLocale); Loading