summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-10-01 11:21:08 +0900
committerKeisuke Kuroyanagi <ksk@google.com>2014-10-01 11:21:08 +0900
commitc6a6f6a9905ab98516d944ac85933d016e4147fb (patch)
treed191a3f3e93e5972e35293d264900b5222147110 /tools
parent79bb37d499ed6fcabe981153d5ff0b5b69509933 (diff)
downloadandroid_packages_inputmethods_LatinIME-c6a6f6a9905ab98516d944ac85933d016e4147fb.tar.gz
android_packages_inputmethods_LatinIME-c6a6f6a9905ab98516d944ac85933d016e4147fb.tar.bz2
android_packages_inputmethods_LatinIME-c6a6f6a9905ab98516d944ac85933d016e4147fb.zip
Introduce NgramProperty in Java side.
Bug: 14425059 Change-Id: I8b3458ad22730b3dccbe0caea2c5930f5276dc82
Diffstat (limited to 'tools')
-rw-r--r--tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java2
-rw-r--r--tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java4
-rw-r--r--tools/dicttool/src/com/android/inputmethod/latin/dicttool/XmlDictInputOutput.java6
3 files changed, 6 insertions, 6 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 94d1ae8bb..c6818ce0c 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java
@@ -135,7 +135,7 @@ public class Diff extends Dicttool.Command {
hasDifferences = true;
}
hasDifferences |= hasAttributesDifferencesAndPrintThemIfAny(word0Property.mWord,
- "Bigram", word0Property.mBigrams, word1PtNode.getBigrams());
+ "Bigram", word0Property.getBigrams(), word1PtNode.getBigrams());
hasDifferences |= hasAttributesDifferencesAndPrintThemIfAny(word0Property.mWord,
"Shortcut", word0Property.mShortcutTargets,
word1PtNode.getShortcutTargets());
diff --git a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java
index 9b2567fd3..2850e1ff6 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java
@@ -45,8 +45,8 @@ public class Info extends Dicttool.Command {
int whitelistCount = 0;
for (final WordProperty wordProperty : dict) {
++wordCount;
- if (null != wordProperty.mBigrams) {
- bigramCount += wordProperty.mBigrams.size();
+ if (wordProperty.mHasNgrams) {
+ bigramCount += wordProperty.mNgrams.size();
}
if (null != wordProperty.mShortcutTargets) {
shortcutCount += wordProperty.mShortcutTargets.size();
diff --git a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/XmlDictInputOutput.java b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/XmlDictInputOutput.java
index bdec44761..cd3ce70eb 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/XmlDictInputOutput.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/XmlDictInputOutput.java
@@ -353,7 +353,7 @@ public class XmlDictInputOutput {
+ "\" " + PROBABILITY_ATTR + "=\"" + wordProperty.getProbability()
+ (wordProperty.mIsNotAWord ? "\" " + NOT_A_WORD_ATTR + "=\"true" : "")
+ "\">");
- if (null != wordProperty.mShortcutTargets) {
+ if (wordProperty.mHasShortcuts) {
destination.write("\n");
for (WeightedString target : wordProperty.mShortcutTargets) {
destination.write(" <" + SHORTCUT_TAG + " " + PROBABILITY_ATTR + "=\""
@@ -362,9 +362,9 @@ public class XmlDictInputOutput {
}
destination.write(" ");
}
- if (null != wordProperty.mBigrams) {
+ if (wordProperty.mHasNgrams) {
destination.write("\n");
- for (WeightedString bigram : wordProperty.mBigrams) {
+ for (WeightedString bigram : wordProperty.getBigrams()) {
destination.write(" <" + BIGRAM_TAG + " " + PROBABILITY_ATTR + "=\""
+ bigram.getProbability() + "\">" + bigram.mWord
+ "</" + BIGRAM_TAG + ">\n");