aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/Android.mk15
-rw-r--r--tools/dicttool/Android.bp32
-rw-r--r--tools/dicttool/Android.mk87
-rw-r--r--tools/dicttool/NativeLib.mk46
-rw-r--r--tools/dicttool/compat/com/android/inputmethod/latin/define/JniLibName.java2
-rw-r--r--tools/dicttool/etc/Android.mk19
-rwxr-xr-xtools/dicttool/etc/dicttool_aosp67
-rwxr-xr-xtools/dicttool/etc/makedict_aosp18
-rw-r--r--tools/dicttool/etc/manifest.txt1
-rw-r--r--tools/dicttool/src/com/android/inputmethod/latin/dicttool/CombinedInputOutput.java25
-rw-r--r--tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java3
-rw-r--r--tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java20
-rw-r--r--tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java14
-rw-r--r--tools/dicttool/tests/com/android/inputmethod/latin/makedict/BinaryDictEncoderFlattenTreeTests.java10
-rw-r--r--tools/dicttool/tests/com/android/inputmethod/latin/makedict/FusionDictionaryTest.java2
-rw-r--r--tools/make-keyboard-text/Android.bp22
-rw-r--r--tools/make-keyboard-text/Android.mk25
-rw-r--r--tools/make-keyboard-text/etc/Android.mk20
-rwxr-xr-xtools/make-keyboard-text/etc/make-keyboard-text63
-rw-r--r--tools/make-keyboard-text/etc/manifest.txt1
20 files changed, 70 insertions, 422 deletions
diff --git a/tools/Android.mk b/tools/Android.mk
deleted file mode 100644
index 91b2fbbb0..000000000
--- a/tools/Android.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (C) 2010 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-include $(call all-subdir-makefiles)
diff --git a/tools/dicttool/Android.bp b/tools/dicttool/Android.bp
new file mode 100644
index 000000000..83b4ed32c
--- /dev/null
+++ b/tools/dicttool/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2012 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+java_binary_host {
+ name: "dicttool_aosp",
+
+ srcs: [
+ "src/**/*.java",
+ "tests/**/*.java",
+ "compat/**/*.java",
+ ":dicttool_deps",
+ ],
+
+ libs: ["junit"],
+ static_libs: [
+ "jsr305",
+ "latinime-common",
+ ],
+ required: ["libjni_latinime"],
+ main_class: "com.android.inputmethod.latin.dicttool.Dicttool",
+}
diff --git a/tools/dicttool/Android.mk b/tools/dicttool/Android.mk
deleted file mode 100644
index 49816294f..000000000
--- a/tools/dicttool/Android.mk
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# Copyright (C) 2012 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Only build if it's explicitly requested, or running mm/mmm.
-ifneq ($(ONE_SHOT_MAKEFILE)$(filter $(MAKECMDGOALS),dicttool_aosp),)
-
-LATINIME_DICTTOOL_AOSP_LOCAL_PATH := $(call my-dir)
-LOCAL_PATH := $(LATINIME_DICTTOOL_AOSP_LOCAL_PATH)
-LATINIME_HOST_NATIVE_LIBNAME := liblatinime-aosp-dicttool-host
-include $(LOCAL_PATH)/NativeLib.mk
-
-######################################
-LOCAL_PATH := $(LATINIME_DICTTOOL_AOSP_LOCAL_PATH)
-include $(CLEAR_VARS)
-
-LATINIME_LOCAL_DIR := ../..
-LATINIME_BASE_SRC_DIR := $(LATINIME_LOCAL_DIR)/java/src/com/android/inputmethod
-LATINIME_BASE_OVERRIDABLE_SRC_DIR := \
- $(LATINIME_LOCAL_DIR)/java-overridable/src/com/android/inputmethod
-MAKEDICT_CORE_SRC_DIR := $(LATINIME_BASE_SRC_DIR)/latin/makedict
-LATINIME_TESTS_SRC_DIR := $(LATINIME_LOCAL_DIR)/tests/src/com/android/inputmethod/latin
-
-# Dependencies for Dicttool. Most of these files are needed by BinaryDictionary.java. Note that
-# a significant part of the dependencies are mocked in the compat/ directory, with empty or
-# nearly-empty implementations, for parts that we don't use in Dicttool.
-LATINIME_SRC_FILES_FOR_DICTTOOL := \
- latin/BinaryDictionary.java \
- latin/DicTraverseSession.java \
- latin/Dictionary.java \
- latin/NgramContext.java \
- latin/SuggestedWords.java \
- latin/settings/SettingsValuesForSuggestion.java \
- latin/utils/BinaryDictionaryUtils.java \
- latin/utils/CombinedFormatUtils.java \
- latin/utils/JniUtils.java
-
-LATINIME_OVERRIDABLE_SRC_FILES_FOR_DICTTOOL := \
- latin/define/DebugFlags.java
-
-LATINIME_TEST_SRC_FILES_FOR_DICTTOOL := \
- utils/ByteArrayDictBuffer.java
-
-USED_TARGETED_SRC_FILES := \
- $(addprefix $(LATINIME_BASE_SRC_DIR)/, $(LATINIME_SRC_FILES_FOR_DICTTOOL)) \
- $(addprefix $(LATINIME_BASE_OVERRIDABLE_SRC_DIR)/, \
- $(LATINIME_OVERRIDABLE_SRC_FILES_FOR_DICTTOOL)) \
- $(addprefix $(LATINIME_TESTS_SRC_DIR)/, $(LATINIME_TEST_SRC_FILES_FOR_DICTTOOL))
-
-DICTTOOL_ONDEVICE_TESTS_DIR := \
- $(LATINIME_LOCAL_DIR)/tests/src/com/android/inputmethod/latin/makedict/
-DICTTOOL_COMPAT_TESTS_DIR := compat
-
-LOCAL_MAIN_SRC_FILES := $(call all-java-files-under, $(MAKEDICT_CORE_SRC_DIR))
-LOCAL_TOOL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_SRC_FILES := $(LOCAL_TOOL_SRC_FILES) \
- $(filter-out $(addprefix %/, $(notdir $(LOCAL_TOOL_SRC_FILES))), $(LOCAL_MAIN_SRC_FILES)) \
- $(USED_TARGETED_SRC_FILES) \
- $(call all-java-files-under, \
- tests $(DICTTOOL_COMPAT_TESTS_DIR) $(DICTTOOL_ONDEVICE_TESTS_DIR))
-
-LOCAL_JAVA_LIBRARIES := junit-host
-LOCAL_STATIC_JAVA_LIBRARIES := jsr305lib latinime-common-host
-LOCAL_REQUIRED_MODULES := $(LATINIME_HOST_NATIVE_LIBNAME)
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-LOCAL_MODULE := dicttool_aosp
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-include $(LOCAL_PATH)/etc/Android.mk
-
-# Clear our private variables
-LATINIME_DICTTOOL_AOSP_LOCAL_PATH :=
-LATINIME_LOCAL_DIR :=
-
-endif
diff --git a/tools/dicttool/NativeLib.mk b/tools/dicttool/NativeLib.mk
deleted file mode 100644
index 510f18c4e..000000000
--- a/tools/dicttool/NativeLib.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (C) 2013 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Need to define the name of the library in the caller in LATINIME_HOST_NATIVE_LIBNAME
-
-LATINIME_DIR_RELATIVE_TO_DICTTOOL := ../..
-
-ifeq ($(FLAG_DBG), true)
- $(warning Making debug version of native library)
- LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline
-endif #FLAG_DBG
-
-LOCAL_CFLAGS += -DHOST_TOOL -fPIC -Wno-deprecated -Wno-unused-parameter -Wno-unused-function
-
-LATINIME_NATIVE_JNI_DIR := $(LATINIME_DIR_RELATIVE_TO_DICTTOOL)/native/jni
-LATINIME_NATIVE_SRC_DIR := $(LATINIME_DIR_RELATIVE_TO_DICTTOOL)/native/jni/src
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(LATINIME_NATIVE_SRC_DIR)
-
-include $(LOCAL_PATH)/$(LATINIME_NATIVE_JNI_DIR)/NativeFileList.mk
-
-LOCAL_SRC_FILES := \
- $(addprefix $(LATINIME_NATIVE_JNI_DIR)/, $(LATIN_IME_JNI_SRC_FILES)) \
- $(addprefix $(LATINIME_NATIVE_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
-
-LOCAL_MODULE := $(LATINIME_HOST_NATIVE_LIBNAME)
-
-include $(BUILD_HOST_SHARED_LIBRARY)
-
-# Clear our private variables
-include $(LOCAL_PATH)/$(LATINIME_NATIVE_JNI_DIR)/CleanupNativeFileList.mk
-LATINIME_DIR_RELATIVE_TO_DICTTOOL := ../..
diff --git a/tools/dicttool/compat/com/android/inputmethod/latin/define/JniLibName.java b/tools/dicttool/compat/com/android/inputmethod/latin/define/JniLibName.java
index d6d5e2d61..93ac1980a 100644
--- a/tools/dicttool/compat/com/android/inputmethod/latin/define/JniLibName.java
+++ b/tools/dicttool/compat/com/android/inputmethod/latin/define/JniLibName.java
@@ -21,5 +21,5 @@ public final class JniLibName {
// This class is not publicly instantiable.
}
- public static final String JNI_LIB_NAME = "latinime-aosp-dicttool-host";
+ public static final String JNI_LIB_NAME = "jni_latinime";
}
diff --git a/tools/dicttool/etc/Android.mk b/tools/dicttool/etc/Android.mk
deleted file mode 100644
index 0c611b7e9..000000000
--- a/tools/dicttool/etc/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (C) 2012 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_EXECUTABLES := dicttool_aosp makedict_aosp
-include $(BUILD_HOST_PREBUILT)
diff --git a/tools/dicttool/etc/dicttool_aosp b/tools/dicttool/etc/dicttool_aosp
deleted file mode 100755
index fc918f0f8..000000000
--- a/tools/dicttool/etc/dicttool_aosp
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-# Copyright 2011, The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
- newProg=`/bin/ls -ld "${prog}"`
- newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
- if expr "x${newProg}" : 'x/' >/dev/null; then
- prog="${newProg}"
- else
- progdir=`dirname "${prog}"`
- prog="${progdir}/${newProg}"
- fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-cd "${oldwd}"
-
-classname=com.android.inputmethod.latin.dicttool.Dicttool
-jarfile=dicttool_aosp.jar
-frameworkdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
- frameworkdir=`dirname "$progdir"`/framework
- libdir=`dirname "$progdir"`/lib64
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
- echo `basename "$prog"`": can't find $jarfile"
- exit 1
-fi
-
-lib=junit.jar
-if [ ! -r "$frameworkdir/$lib" ]
-then
- echo `basename "$prog"`": can't find lib $lib"
- exit 1
-fi
-
-if [ "$OSTYPE" = "cygwin" ] ; then
- jarpath=`cygpath -w "$frameworkdir/$jarfile"`
- libpath=`cygpath -w "$frameworkdir/$lib"`
- progdir=`cygpath -w "$progdir"`
-else
- jarpath="$frameworkdir/$jarfile"
- libpath="$frameworkdir/$lib"
-fi
-
-# might need more memory, e.g. -Xmx128M
-exec java -ea -classpath "$libpath":"$jarpath" -Djava.library.path="$libdir" "$classname" "$@"
diff --git a/tools/dicttool/etc/makedict_aosp b/tools/dicttool/etc/makedict_aosp
deleted file mode 100755
index 095c50538..000000000
--- a/tools/dicttool/etc/makedict_aosp
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2012, The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Dicttool supports making the dictionary using the 'makedict' command and
-# the same arguments that the old 'makedict' command used to accept.
-dicttool_aosp makedict $@
diff --git a/tools/dicttool/etc/manifest.txt b/tools/dicttool/etc/manifest.txt
deleted file mode 100644
index 67c85214c..000000000
--- a/tools/dicttool/etc/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Main-Class: com.android.inputmethod.latin.dicttool.Dicttool
diff --git a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/CombinedInputOutput.java b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/CombinedInputOutput.java
index 955c5728c..5e7aca5bb 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/CombinedInputOutput.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/CombinedInputOutput.java
@@ -106,8 +106,7 @@ public class CombinedInputOutput {
final String args[] = line.trim().split(",");
if (args[0].matches(CombinedFormatUtils.WORD_TAG + "=.*")) {
if (null != word) {
- dict.add(word, probabilityInfo, shortcuts.isEmpty() ? null : shortcuts,
- isNotAWord, isPossiblyOffensive);
+ dict.add(word, probabilityInfo, isNotAWord, isPossiblyOffensive);
for (WeightedString s : bigrams) {
dict.setBigram(word, s.mWord, s.mProbabilityInfo);
}
@@ -148,25 +147,6 @@ public class CombinedInputOutput {
break;
}
}
- } else if (args[0].matches(CombinedFormatUtils.SHORTCUT_TAG + "=.*")) {
- String shortcut = null;
- int shortcutFreq = 0;
- for (String param : args) {
- final String params[] = param.split("=", 2);
- if (2 != params.length) throw new RuntimeException("Wrong format : " + line);
- if (CombinedFormatUtils.SHORTCUT_TAG.equals(params[0])) {
- shortcut = params[1];
- } else if (CombinedFormatUtils.PROBABILITY_TAG.equals(params[0])) {
- shortcutFreq = WHITELIST_TAG.equals(params[1])
- ? FormatSpec.SHORTCUT_WHITELIST_FREQUENCY
- : Integer.parseInt(params[1]);
- }
- }
- if (null != shortcut) {
- shortcuts.add(new WeightedString(shortcut, shortcutFreq));
- } else {
- throw new RuntimeException("Wrong format : " + line);
- }
} else if (args[0].matches(CombinedFormatUtils.BIGRAM_TAG + "=.*")) {
String secondWordOfBigram = null;
ProbabilityInfo bigramProbabilityInfo = new ProbabilityInfo(0);
@@ -200,8 +180,7 @@ public class CombinedInputOutput {
}
}
if (null != word) {
- dict.add(word, probabilityInfo, shortcuts.isEmpty() ? null : shortcuts, isNotAWord,
- isPossiblyOffensive);
+ dict.add(word, probabilityInfo, isNotAWord, isPossiblyOffensive);
for (WeightedString s : bigrams) {
dict.setBigram(word, s.mWord, s.mProbabilityInfo);
}
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 f97fbef2c..4ba7e1309 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java
@@ -136,9 +136,6 @@ public class Diff extends Dicttool.Command {
}
hasDifferences |= hasAttributesDifferencesAndPrintThemIfAny(word0Property.mWord,
"Bigram", word0Property.getBigrams(), word1PtNode.getBigrams());
- hasDifferences |= hasAttributesDifferencesAndPrintThemIfAny(word0Property.mWord,
- "Shortcut", word0Property.mShortcutTargets,
- word1PtNode.getShortcutTargets());
}
}
for (final WordProperty word1Property : dict1) {
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 b8a64e31a..d516d60c3 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java
@@ -48,15 +48,6 @@ public class Info extends Dicttool.Command {
if (wordProperty.mHasNgrams) {
bigramCount += wordProperty.mNgrams.size();
}
- if (null != wordProperty.mShortcutTargets) {
- shortcutCount += wordProperty.mShortcutTargets.size();
- for (WeightedString shortcutTarget : wordProperty.mShortcutTargets) {
- if (FormatSpec.SHORTCUT_WHITELIST_FREQUENCY
- == shortcutTarget.getProbability()) {
- ++whitelistCount;
- }
- }
- }
}
System.out.println("Words in the dictionary : " + wordCount);
System.out.println("Bigram count : " + bigramCount);
@@ -78,17 +69,6 @@ public class Info extends Dicttool.Command {
if (ptNode.getIsPossiblyOffensive()) {
System.out.println(" Is possibly offensive");
}
- final ArrayList<WeightedString> shortcutTargets = ptNode.getShortcutTargets();
- if (null == shortcutTargets || shortcutTargets.isEmpty()) {
- System.out.println(" No shortcuts");
- } else {
- for (final WeightedString shortcutTarget : shortcutTargets) {
- System.out.println(" Shortcut target: " + shortcutTarget.mWord + " ("
- + (FormatSpec.SHORTCUT_WHITELIST_FREQUENCY
- == shortcutTarget.getProbability() ?
- "whitelist" : shortcutTarget.getProbability()) + ")");
- }
- }
final ArrayList<WeightedString> bigrams = ptNode.getBigrams();
if (null == bigrams || bigrams.isEmpty()) {
System.out.println(" No bigrams");
diff --git a/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java b/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java
index e68aeb0eb..84d36a0c3 100644
--- a/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java
+++ b/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java
@@ -85,15 +85,15 @@ public class BinaryDictOffdeviceUtilsTests extends TestCase {
testOptions.mAttributes.put(DictionaryHeader.DICTIONARY_LOCALE_KEY, LOCALE);
testOptions.mAttributes.put(DictionaryHeader.DICTIONARY_ID_KEY, ID);
final FusionDictionary dict = new FusionDictionary(new PtNodeArray(), testOptions);
- dict.add("foo", new ProbabilityInfo(TEST_FREQ), null, false /* isNotAWord */,
+ dict.add("foo", new ProbabilityInfo(TEST_FREQ), false /* isNotAWord */,
false /* isPossiblyOffensive */);
- dict.add("fta", new ProbabilityInfo(1), null, false /* isNotAWord */,
+ dict.add("fta", new ProbabilityInfo(1), false /* isNotAWord */,
false /* isPossiblyOffensive */);
- dict.add("ftb", new ProbabilityInfo(1), null, false /* isNotAWord */,
+ dict.add("ftb", new ProbabilityInfo(1), false /* isNotAWord */,
false /* isPossiblyOffensive */);
- dict.add("bar", new ProbabilityInfo(1), null, false /* isNotAWord */,
+ dict.add("bar", new ProbabilityInfo(1), false /* isNotAWord */,
false /* isPossiblyOffensive */);
- dict.add("fool", new ProbabilityInfo(1), null, false /* isNotAWord */,
+ dict.add("fool", new ProbabilityInfo(1), false /* isNotAWord */,
false /* isPossiblyOffensive */);
final File dst = File.createTempFile("testGetRawDict", ".tmp");
@@ -171,8 +171,8 @@ public class BinaryDictOffdeviceUtilsTests extends TestCase {
for (int i = 0; i < sWords.size(); ++i) {
final String word = sWords.get(i);
- dict.add(word, new ProbabilityInfo(TEST_FREQ), null /* shortcuts */,
- false /* isNotAWord */, false /* isPossiblyOffensive */);
+ dict.add(word, new ProbabilityInfo(TEST_FREQ), false /* isNotAWord */,
+ false /* isPossiblyOffensive */);
}
File file = File.createTempFile(dictName, ".tmp");
diff --git a/tools/dicttool/tests/com/android/inputmethod/latin/makedict/BinaryDictEncoderFlattenTreeTests.java b/tools/dicttool/tests/com/android/inputmethod/latin/makedict/BinaryDictEncoderFlattenTreeTests.java
index dc9981d1a..178fc41e2 100644
--- a/tools/dicttool/tests/com/android/inputmethod/latin/makedict/BinaryDictEncoderFlattenTreeTests.java
+++ b/tools/dicttool/tests/com/android/inputmethod/latin/makedict/BinaryDictEncoderFlattenTreeTests.java
@@ -33,15 +33,15 @@ public class BinaryDictEncoderFlattenTreeTests extends TestCase {
public void testFlattenNodes() {
final FusionDictionary dict = new FusionDictionary(new PtNodeArray(),
new DictionaryOptions(new HashMap<String, String>()));
- dict.add("foo", new ProbabilityInfo(1), null, false /* isNotAWord */,
+ dict.add("foo", new ProbabilityInfo(1), false /* isNotAWord */,
false /* isPossiblyOffensive */);
- dict.add("fta", new ProbabilityInfo(1), null, false /* isNotAWord */,
+ dict.add("fta", new ProbabilityInfo(1), false /* isNotAWord */,
false /* isPossiblyOffensive */);
- dict.add("ftb", new ProbabilityInfo(1), null, false /* isNotAWord */,
+ dict.add("ftb", new ProbabilityInfo(1), false /* isNotAWord */,
false /* isPossiblyOffensive */);
- dict.add("bar", new ProbabilityInfo(1), null, false /* isNotAWord */,
+ dict.add("bar", new ProbabilityInfo(1), false /* isNotAWord */,
false /* isPossiblyOffensive */);
- dict.add("fool", new ProbabilityInfo(1), null, false /* isNotAWord */,
+ dict.add("fool", new ProbabilityInfo(1), false /* isNotAWord */,
false /* isPossiblyOffensive */);
final ArrayList<PtNodeArray> result =
BinaryDictEncoderUtils.flattenTree(dict.mRootNodeArray);
diff --git a/tools/dicttool/tests/com/android/inputmethod/latin/makedict/FusionDictionaryTest.java b/tools/dicttool/tests/com/android/inputmethod/latin/makedict/FusionDictionaryTest.java
index 1a4f096e4..626023920 100644
--- a/tools/dicttool/tests/com/android/inputmethod/latin/makedict/FusionDictionaryTest.java
+++ b/tools/dicttool/tests/com/android/inputmethod/latin/makedict/FusionDictionaryTest.java
@@ -102,7 +102,7 @@ public class FusionDictionaryTest extends TestCase {
prepare(time);
for (int i = 0; i < sWords.size(); ++i) {
System.out.println("Adding in pos " + i + " : " + dumpWord(sWords.get(i)));
- dict.add(sWords.get(i), new ProbabilityInfo(180), null, false,
+ dict.add(sWords.get(i), new ProbabilityInfo(180), false,
false /* isPossiblyOffensive */);
dumpDict(dict);
checkDictionary(dict, sWords, i);
diff --git a/tools/make-keyboard-text/Android.bp b/tools/make-keyboard-text/Android.bp
new file mode 100644
index 000000000..4976051da
--- /dev/null
+++ b/tools/make-keyboard-text/Android.bp
@@ -0,0 +1,22 @@
+//
+// Copyright (C) 2012 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+java_binary_host {
+ name: "make-keyboard-text",
+
+ srcs: ["src/**/*.java"],
+ main_class: "com.android.inputmethod.keyboard.tools.MakeKeyboardText",
+ java_resource_dirs: ["res"],
+}
diff --git a/tools/make-keyboard-text/Android.mk b/tools/make-keyboard-text/Android.mk
deleted file mode 100644
index 87601489e..000000000
--- a/tools/make-keyboard-text/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Copyright (C) 2012 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES += $(call all-java-files-under,src)
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-LOCAL_JAVA_RESOURCE_DIRS := res
-LOCAL_MODULE := make-keyboard-text
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-include $(LOCAL_PATH)/etc/Android.mk
diff --git a/tools/make-keyboard-text/etc/Android.mk b/tools/make-keyboard-text/etc/Android.mk
deleted file mode 100644
index 0fbf4ffe9..000000000
--- a/tools/make-keyboard-text/etc/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2012 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_EXECUTABLES := make-keyboard-text
-
-include $(BUILD_HOST_PREBUILT)
diff --git a/tools/make-keyboard-text/etc/make-keyboard-text b/tools/make-keyboard-text/etc/make-keyboard-text
deleted file mode 100755
index 156f9ec5f..000000000
--- a/tools/make-keyboard-text/etc/make-keyboard-text
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/sh
-# Copyright 2012, The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
- newProg=`/bin/ls -ld "${prog}"`
- newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
- if expr "x${newProg}" : 'x/' >/dev/null; then
- prog="${newProg}"
- else
- progdir=`dirname "${prog}"`
- prog="${progdir}/${newProg}"
- fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-cd "${oldwd}"
-
-jarfile=make-keyboard-text.jar
-frameworkdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
- frameworkdir=`dirname "$progdir"`/tools/lib
- libdir=`dirname "$progdir"`/tools/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
- frameworkdir=`dirname "$progdir"`/framework
- libdir=`dirname "$progdir"`/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
- echo `basename "$prog"`": can't find $jarfile"
- exit 1
-fi
-
-if [ "$OSTYPE" = "cygwin" ] ; then
- jarpath=`cygpath -w "$frameworkdir/$jarfile"`
- progdir=`cygpath -w "$progdir"`
-else
- jarpath="$frameworkdir/$jarfile"
-fi
-
-# need to use "java.ext.dirs" because "-jar" causes classpath to be ignored
-# might need more memory, e.g. -Xmx128M
-exec java -ea -jar "$jarpath" "$@"
diff --git a/tools/make-keyboard-text/etc/manifest.txt b/tools/make-keyboard-text/etc/manifest.txt
deleted file mode 100644
index 8ad4db059..000000000
--- a/tools/make-keyboard-text/etc/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Main-Class: com.android.inputmethod.keyboard.tools.MakeKeyboardText