aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2013-12-17 01:46:00 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-12-17 01:46:00 -0800
commite38963c97ca35f0175aac98f9d25f708a4a6aa0f (patch)
tree75236dc69e8e950cacceea21f0aa046a873b281f
parentc0174db8f9da4a4d93a7f65aa19f80782432fe1b (diff)
parent42334bb49343099e71104a9ab2b1d299a16ebe30 (diff)
downloadlatinime-e38963c97ca35f0175aac98f9d25f708a4a6aa0f.tar.gz
latinime-e38963c97ca35f0175aac98f9d25f708a4a6aa0f.tar.xz
latinime-e38963c97ca35f0175aac98f9d25f708a4a6aa0f.zip
am 42334bb4: Quit checking bigram order in BinaryDictDecoderEncoderTests.
* commit '42334bb49343099e71104a9ab2b1d299a16ebe30': Quit checking bigram order in BinaryDictDecoderEncoderTests.
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
index 8f7f31d18..8c5da254b 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
@@ -355,25 +355,25 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
}
// check bigrams
- final HashMap<String, List<String>> expBigrams = new HashMap<String, List<String>>();
+ final HashMap<String, Set<String>> expBigrams = new HashMap<String, Set<String>>();
for (int i = 0; i < expectedBigrams.size(); ++i) {
final String word1 = expectedWords.get(expectedBigrams.keyAt(i));
for (int w2 : expectedBigrams.valueAt(i)) {
if (expBigrams.get(word1) == null) {
- expBigrams.put(word1, new ArrayList<String>());
+ expBigrams.put(word1, new HashSet<String>());
}
expBigrams.get(word1).add(expectedWords.get(w2));
}
}
- final HashMap<String, List<String>> actBigrams = new HashMap<String, List<String>>();
+ final HashMap<String, Set<String>> actBigrams = new HashMap<String, Set<String>>();
for (Entry<Integer, ArrayList<PendingAttribute>> entry : resultBigrams.entrySet()) {
final String word1 = resultWords.get(entry.getKey());
final int unigramFreq = resultFrequencies.get(entry.getKey());
for (PendingAttribute attr : entry.getValue()) {
final String word2 = resultWords.get(attr.mAddress);
if (actBigrams.get(word1) == null) {
- actBigrams.put(word1, new ArrayList<String>());
+ actBigrams.put(word1, new HashSet<String>());
}
actBigrams.get(word1).add(word2);
@@ -382,7 +382,6 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
assertTrue(Math.abs(bigramFreq - BIGRAM_FREQ) < TOLERANCE_OF_BIGRAM_FREQ);
}
}
-
assertEquals(actBigrams, expBigrams);
}