aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/UserBigramDictionary.java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2010-12-27 20:13:16 +0900
committersatok <satok@google.com>2010-12-27 20:13:16 +0900
commitd12def6dc8ba3a2f47b90e6d5d442f315152c6d4 (patch)
tree7274b29f518f94d31cd5c995d1b46bfc323de818 /java/src/com/android/inputmethod/latin/UserBigramDictionary.java
parentb80f171623a11bceb99b563594162d0034b9bde8 (diff)
parentbfe2b534457d946645d483e311249787ba4fc3ae (diff)
downloadlatinime-d12def6dc8ba3a2f47b90e6d5d442f315152c6d4.tar.gz
latinime-d12def6dc8ba3a2f47b90e6d5d442f315152c6d4.tar.xz
latinime-d12def6dc8ba3a2f47b90e6d5d442f315152c6d4.zip
Merge remote branch 'goog/master' into merge
Conflicts: java/res/values-cs/strings.xml java/res/values-da/strings.xml java/res/values-de/strings.xml java/res/values-el/strings.xml java/res/values-es-rUS/strings.xml java/res/values-es/strings.xml java/res/values-fr/strings.xml java/res/values-it/strings.xml java/res/values-ja/strings.xml java/res/values-ko/strings.xml java/res/values-nb/strings.xml java/res/values-nl/strings.xml java/res/values-pl/strings.xml java/res/values-pt-rPT/strings.xml java/res/values-pt/strings.xml java/res/values-ru/strings.xml java/res/values-sv/strings.xml java/res/values-tr/strings.xml java/res/values-xlarge/dimens.xml java/res/values-zh-rCN/strings.xml java/res/values-zh-rTW/strings.xml java/res/values/bools.xml java/res/xml/kbd_qwerty_rows.xml java/res/xml/method.xml java/res/xml/prefs.xml Change-Id: I8768d16965e6e82c14ee742b9ada56438497eb86
Diffstat (limited to 'java/src/com/android/inputmethod/latin/UserBigramDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/UserBigramDictionary.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/latin/UserBigramDictionary.java b/java/src/com/android/inputmethod/latin/UserBigramDictionary.java
index 67d9c0bcf..4750fb991 100644
--- a/java/src/com/android/inputmethod/latin/UserBigramDictionary.java
+++ b/java/src/com/android/inputmethod/latin/UserBigramDictionary.java
@@ -16,10 +16,6 @@
package com.android.inputmethod.latin;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
@@ -30,6 +26,10 @@ import android.os.AsyncTask;
import android.provider.BaseColumns;
import android.util.Log;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+
/**
* Stores all the pairs user types in databases. Prune the database if the size
* gets too big. Unlike AutoDictionary, it even stores the pairs that are already
@@ -108,25 +108,25 @@ public class UserBigramDictionary extends ExpandableDictionary {
private static DatabaseHelper sOpenHelper = null;
private static class Bigram {
- String word1;
- String word2;
- int frequency;
+ public final String mWord1;
+ public final String mWord2;
+ public final int frequency;
Bigram(String word1, String word2, int frequency) {
- this.word1 = word1;
- this.word2 = word2;
+ this.mWord1 = word1;
+ this.mWord2 = word2;
this.frequency = frequency;
}
@Override
public boolean equals(Object bigram) {
Bigram bigram2 = (Bigram) bigram;
- return (word1.equals(bigram2.word1) && word2.equals(bigram2.word2));
+ return (mWord1.equals(bigram2.mWord1) && mWord2.equals(bigram2.mWord2));
}
@Override
public int hashCode() {
- return (word1 + " " + word2).hashCode();
+ return (mWord1 + " " + mWord2).hashCode();
}
}
@@ -357,7 +357,7 @@ public class UserBigramDictionary extends ExpandableDictionary {
Cursor c = db.query(MAIN_TABLE_NAME, new String[] { MAIN_COLUMN_ID },
MAIN_COLUMN_WORD1 + "=? AND " + MAIN_COLUMN_WORD2 + "=? AND "
+ MAIN_COLUMN_LOCALE + "=?",
- new String[] { bi.word1, bi.word2, mLocale }, null, null, null);
+ new String[] { bi.mWord1, bi.mWord2, mLocale }, null, null, null);
int pairId;
if (c.moveToFirst()) {
@@ -368,7 +368,7 @@ public class UserBigramDictionary extends ExpandableDictionary {
} else {
// new pair
Long pairIdLong = db.insert(MAIN_TABLE_NAME, null,
- getContentValues(bi.word1, bi.word2, mLocale));
+ getContentValues(bi.mWord1, bi.mWord2, mLocale));
pairId = pairIdLong.intValue();
}
c.close();