Revive the Makefile for makedict

Follow up to I4d2ef504.  Address a compiler warning and a small optimization as well.

bug: 6188977
bug: 6209651
Change-Id: Ibc9da51d48ebf0b8815ad0bb2f697242970ba8f7
This commit is contained in:
Ken Wakasa 2012-03-22 02:40:45 +09:00
parent 9c4396abb3
commit 2aa02b84a4
2 changed files with 19 additions and 22 deletions

View File

@ -21,7 +21,6 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
/**
* A dictionary that can fusion heads and tails of words for more compression.
@ -400,16 +399,11 @@ public class FusionDictionary implements Iterable<Word> {
* is ignored.
* This comparator imposes orderings that are inconsistent with equals.
*/
static private class CharGroupComparator implements java.util.Comparator {
public int compare(Object o1, Object o2) {
final CharGroup c1 = (CharGroup)o1;
final CharGroup c2 = (CharGroup)o2;
static private class CharGroupComparator implements java.util.Comparator<CharGroup> {
public int compare(CharGroup c1, CharGroup c2) {
if (c1.mChars[0] == c2.mChars[0]) return 0;
return c1.mChars[0] < c2.mChars[0] ? -1 : 1;
}
public boolean equals(Object o) {
return o instanceof CharGroupComparator;
}
}
final static private CharGroupComparator CHARGROUP_COMPARATOR = new CharGroupComparator();
@ -417,7 +411,7 @@ public class FusionDictionary implements Iterable<Word> {
* Finds the insertion index of a character within a node.
*/
private static int findInsertionIndex(final Node node, int character) {
final List data = node.mData;
final ArrayList<CharGroup> data = node.mData;
final CharGroup reference = new CharGroup(new int[] { character }, null, null, 0,
false /* isShortcutOnly */);
int result = Collections.binarySearch(data, reference, CHARGROUP_COMPARATOR);

View File

@ -12,16 +12,19 @@
# 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_SRC_FILES += $(call all-java-files-under,tests)
#LOCAL_JAR_MANIFEST := etc/manifest.txt
#LOCAL_MODULE_TAGS := eng
#LOCAL_MODULE := makedict
#LOCAL_JAVA_LIBRARIES := junit
#
#include $(BUILD_HOST_JAVA_LIBRARY)
#include $(LOCAL_PATH)/etc/Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
MAKEDICT_CORE_SOURCE_DIRECTORY := ../../java/src/com/android/inputmethod/latin/makedict
LOCAL_SRC_FILES := $(call all-java-files-under,$(MAKEDICT_CORE_SOURCE_DIRECTORY))
LOCAL_SRC_FILES += $(call all-java-files-under,src)
LOCAL_SRC_FILES += $(call all-java-files-under,tests)
LOCAL_JAR_MANIFEST := etc/manifest.txt
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE := makedict
LOCAL_JAVA_LIBRARIES := junit
include $(BUILD_HOST_JAVA_LIBRARY)
include $(LOCAL_PATH)/etc/Android.mk