aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/BinaryDictionary.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BinaryDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionary.java50
1 files changed, 0 insertions, 50 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
index 851ecc042..05e6ef0d2 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -40,7 +40,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Locale;
-import java.util.Map;
/**
* Implements a static, compacted, binary dictionary of standard words.
@@ -142,8 +141,6 @@ public final class BinaryDictionary extends Dictionary {
JniUtils.loadNativeLibrary();
}
- private static native boolean createEmptyDictFileNative(String filePath, long dictVersion,
- String locale, String[] attributeKeyStringArray, String[] attributeValueStringArray);
private static native long openNative(String sourceDir, long dictOffset, long dictSize,
boolean isUpdatable);
private static native void getHeaderInfoNative(long dict, int[] outHeaderSize,
@@ -167,8 +164,6 @@ public final class BinaryDictionary extends Dictionary {
int[] suggestOptions, int[] prevWordCodePointArray,
int[] outputCodePoints, int[] outputScores, int[] outputIndices, int[] outputTypes,
int[] outputAutoCommitFirstWordConfidence);
- private static native float calcNormalizedScoreNative(int[] before, int[] after, int score);
- private static native int editDistanceNative(int[] before, int[] after);
private static native void addUnigramWordNative(long dict, int[] word, int probability,
int[] shortcutTarget, int shortcutProbability, boolean isNotAWord,
boolean isBlacklisted, int timestamp);
@@ -179,24 +174,9 @@ public final class BinaryDictionary extends Dictionary {
LanguageModelParam[] languageModelParams, int startIndex);
private static native int calculateProbabilityNative(long dict, int unigramProbability,
int bigramProbability);
- private static native int setCurrentTimeForTestNative(int currentTime);
private static native String getPropertyNative(long dict, String query);
private static native boolean isCorruptedNative(long dict);
- public static boolean createEmptyDictFile(final String filePath, final long dictVersion,
- final Locale locale, final Map<String, String> attributeMap) {
- final String[] keyArray = new String[attributeMap.size()];
- final String[] valueArray = new String[attributeMap.size()];
- int index = 0;
- for (final String key : attributeMap.keySet()) {
- keyArray[index] = key;
- valueArray[index] = attributeMap.get(key);
- index++;
- }
- return createEmptyDictFileNative(filePath, dictVersion, locale.toString(), keyArray,
- valueArray);
- }
-
// TODO: Move native dict into session
private final void loadDictionary(final String path, final long startOffset,
final long length, final boolean isUpdatable) {
@@ -323,20 +303,6 @@ public final class BinaryDictionary extends Dictionary {
return getFormatVersionNative(mNativeDict);
}
- public static float calcNormalizedScore(final String before, final String after,
- final int score) {
- return calcNormalizedScoreNative(StringUtils.toCodePointArray(before),
- StringUtils.toCodePointArray(after), score);
- }
-
- public static int editDistance(final String before, final String after) {
- if (before == null || after == null) {
- throw new IllegalArgumentException();
- }
- return editDistanceNative(StringUtils.toCodePointArray(before),
- StringUtils.toCodePointArray(after));
- }
-
@Override
public boolean isValidWord(final String word) {
return getFrequency(word) != NOT_A_PROBABILITY;
@@ -497,22 +463,6 @@ public final class BinaryDictionary extends Dictionary {
return calculateProbabilityNative(mNativeDict, unigramProbability, bigramProbability);
}
- /**
- * Control the current time to be used in the native code. If currentTime >= 0, this method sets
- * the current time and gets into test mode.
- * In test mode, set timestamp is used as the current time in the native code.
- * If currentTime < 0, quit the test mode and returns to using time() to get the current time.
- *
- * @param currentTime seconds since the unix epoch
- * @return current time got in the native code.
- */
- @UsedForTesting
- public static int setCurrentTimeForTest(final int currentTime) {
- final int currentNativeTimestamp = setCurrentTimeForTestNative(currentTime);
- PersonalizationHelper.currentTimeChangedForTesting(currentNativeTimestamp);
- return currentNativeTimestamp;
- }
-
@UsedForTesting
public String getPropertyForTest(final String query) {
if (!isValidDictionary()) return "";