aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2013-05-15 12:46:50 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-05-15 12:46:50 -0700
commita5f0a52d7cbf69778b21bc34d7636314906576bb (patch)
tree7dc6ad6bf41836fa96c168ec7cfdbaa608e08091 /java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
parent8facddba7df124efe0efad8dce661e08419f167a (diff)
parent778eabfe7476b64aaef614c6649d6798b2bbc3bf (diff)
downloadlatinime-a5f0a52d7cbf69778b21bc34d7636314906576bb.tar.gz
latinime-a5f0a52d7cbf69778b21bc34d7636314906576bb.tar.xz
latinime-a5f0a52d7cbf69778b21bc34d7636314906576bb.zip
am 778eabfe: am 244a24e3: Consolidate dummy proximity info to the spell checker info
* commit '778eabfe7476b64aaef614c6649d6798b2bbc3bf': Consolidate dummy proximity info to the spell checker info
Diffstat (limited to 'java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java')
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java17
1 files changed, 5 insertions, 12 deletions
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
index 61850e42e..16e9fb77e 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
@@ -257,7 +257,7 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session {
}
if (shouldFilterOut(inText, mScript)) {
- DictAndProximity dictInfo = null;
+ DictAndKeyboard dictInfo = null;
try {
dictInfo = mDictionaryPool.pollWithDefaultTimeout();
if (!DictionaryPool.isAValidDictionary(dictInfo)) {
@@ -286,7 +286,7 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session {
final int capitalizeType = StringUtils.getCapitalizationType(text);
boolean isInDict = true;
- DictAndProximity dictInfo = null;
+ DictAndKeyboard dictInfo = null;
try {
dictInfo = mDictionaryPool.pollWithDefaultTimeout();
if (!DictionaryPool.isAValidDictionary(dictInfo)) {
@@ -296,20 +296,13 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session {
final int length = text.length();
for (int i = 0; i < length; i = text.offsetByCodePoints(i, 1)) {
final int codePoint = text.codePointAt(i);
- // The getXYForCodePointAndScript method returns (Y << 16) + X
- final int xy = SpellCheckerProximityInfo.getXYForCodePointAndScript(
- codePoint, mScript);
- if (SpellCheckerProximityInfo.NOT_A_COORDINATE_PAIR == xy) {
- composer.add(codePoint,
- Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE);
- } else {
- composer.add(codePoint, xy & 0xFFFF, xy >> 16);
- }
+ composer.addKeyInfo(codePoint, dictInfo.getKeyboard(codePoint));
}
// TODO: make a spell checker option to block offensive words or not
final ArrayList<SuggestedWordInfo> suggestions =
dictInfo.mDictionary.getSuggestions(composer, prevWord,
- dictInfo.mProximityInfo, true /* blockOffensiveWords */);
+ dictInfo.getProximityInfo(),
+ true /* blockOffensiveWords */);
for (final SuggestedWordInfo suggestion : suggestions) {
final String suggestionStr = suggestion.mWord;
suggestionsGatherer.addWord(suggestionStr.toCharArray(), null, 0,