diff options
author | 2012-11-08 11:53:49 +0900 | |
---|---|---|
committer | 2012-11-08 11:57:45 +0900 | |
commit | 5b1037fa94a3f4a64fe0f5aed58662d2e40af5d2 (patch) | |
tree | 8e1525d88af85186cd12e0cda714ecd30382abce /tools/dicttool/src | |
parent | d957ded1d5e22806a42340a741b024e56e7ea01b (diff) | |
download | latinime-5b1037fa94a3f4a64fe0f5aed58662d2e40af5d2.tar.gz latinime-5b1037fa94a3f4a64fe0f5aed58662d2e40af5d2.tar.xz latinime-5b1037fa94a3f4a64fe0f5aed58662d2e40af5d2.zip |
Fix a bug in the diff tool
Fix reporting of removed attributes multiple times instead
of just one in some cases. Also, report the frequency of
the removed bigram in the same cases.
Change-Id: I1455fa7553fcebc3005c222bf5aa9afcf1678c31
Diffstat (limited to 'tools/dicttool/src')
-rw-r--r-- | tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java index 94db84497..5c3e87e10 100644 --- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java +++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java @@ -181,16 +181,21 @@ public class Diff extends Dicttool.Command { if (!list1.contains(attribute0)) { hasDifferences = true; // Search for a word with the same string but a different frequency + boolean foundString = false; for (final WeightedString attribute1 : list1) { if (attribute0.mWord.equals(attribute1.mWord)) { System.out.println(type + " freq changed: " + word + " " + attribute0.mWord + " " + attribute0.mFrequency + " -> " + attribute1.mFrequency); list1.remove(attribute1); + foundString = true; break; } + } + if (!foundString) { // We come here if we haven't found any matching string. - System.out.println(type + " removed: " + word + " " + attribute0.mWord); + System.out.println(type + " removed: " + word + " " + attribute0.mWord + " " + + attribute0.mFrequency); } } else { list1.remove(attribute0); |