aboutsummaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
Diffstat (limited to 'native')
-rw-r--r--native/jni/Android.mk28
-rw-r--r--native/jni/src/correction.cpp3
-rw-r--r--native/jni/src/defines.h2
-rw-r--r--native/jni/src/unigram_dictionary.cpp9
4 files changed, 11 insertions, 31 deletions
diff --git a/native/jni/Android.mk b/native/jni/Android.mk
index 5e0d3518d..d53757fd4 100644
--- a/native/jni/Android.mk
+++ b/native/jni/Android.mk
@@ -20,24 +20,6 @@ LOCAL_PATH := $(call my-dir)
#FLAG_DBG := true
#FLAG_DO_PROFILE := true
-TARGETING_UNBUNDLED_FROYO := true
-
-ifeq ($(TARGET_ARCH), x86)
- TARGETING_UNBUNDLED_FROYO := false
-endif
-
-ifeq ($(TARGET_ARCH), mips)
- TARGETING_UNBUNDLED_FROYO := false
-endif
-
-ifeq ($(FLAG_DBG), true)
- TARGETING_UNBUNDLED_FROYO := false
-endif
-
-ifeq ($(FLAG_DO_PROFILE), true)
- TARGETING_UNBUNDLED_FROYO := false
-endif
-
######################################
include $(CLEAR_VARS)
@@ -69,11 +51,6 @@ LOCAL_SRC_FILES := \
$(LATIN_IME_JNI_SRC_FILES) \
$(addprefix $(LATIN_IME_SRC_DIR)/,$(LATIN_IME_CORE_SRC_FILES))
-ifeq ($(TARGETING_UNBUNDLED_FROYO), true)
- LOCAL_NDK_VERSION := 4
- LOCAL_SDK_VERSION := 8
-endif
-
ifeq ($(FLAG_DO_PROFILE), true)
$(warning Making profiling version of native library)
LOCAL_CFLAGS += -DFLAG_DO_PROFILE
@@ -117,11 +94,6 @@ ifeq ($(FLAG_DBG), true)
endif # FLAG_DBG
endif # FLAG_DO_PROFILE
-ifeq ($(TARGETING_UNBUNDLED_FROYO), true)
- LOCAL_NDK_VERSION := 4
- LOCAL_SDK_VERSION := 8
-endif
-
LOCAL_MODULE := libjni_latinime
LOCAL_MODULE_TAGS := optional
diff --git a/native/jni/src/correction.cpp b/native/jni/src/correction.cpp
index 5ae34cd02..f7ef7efc0 100644
--- a/native/jni/src/correction.cpp
+++ b/native/jni/src/correction.cpp
@@ -55,6 +55,7 @@ inline static void dumpEditDistance10ForDebug(int *editDistanceTable,
}
AKLOGI("[ %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d ]",
c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8], c[9], c[10]);
+ (void)c;
}
}
}
@@ -977,7 +978,7 @@ int Correction::RankingAlgorithm::calcFreqForSplitMultipleWords(
}
const int freq = freqArray[i];
// Demote too short weak words
- if (wordLength <= 4 && freq <= MAX_FREQ * 2 / 3 /* heuristic... */) {
+ if (wordLength <= 4 && freq <= SUPPRESS_SHORT_MULTIPLE_WORDS_THRESHOLD_FREQ) {
multiplyRate(100 * freq / MAX_FREQ, &totalFreq);
}
if (wordLength == 1) {
diff --git a/native/jni/src/defines.h b/native/jni/src/defines.h
index dfc5238a0..19f843446 100644
--- a/native/jni/src/defines.h
+++ b/native/jni/src/defines.h
@@ -228,6 +228,8 @@ static inline void prof_out(void) {
#define TWO_WORDS_CORRECTION_WITH_OTHER_ERROR_THRESHOLD 0.35
#define START_TWO_WORDS_CORRECTION_THRESHOLD 0.185
+/* heuristic... This should be changed if we change the unit of the frequency. */
+#define SUPPRESS_SHORT_MULTIPLE_WORDS_THRESHOLD_FREQ (MAX_FREQ * 58 / 100)
#define MAX_DEPTH_MULTIPLIER 3
diff --git a/native/jni/src/unigram_dictionary.cpp b/native/jni/src/unigram_dictionary.cpp
index 3c826e918..8d2f4cd73 100644
--- a/native/jni/src/unigram_dictionary.cpp
+++ b/native/jni/src/unigram_dictionary.cpp
@@ -222,6 +222,7 @@ int UnigramDictionary::getSuggestions(ProximityInfo *proximityInfo,
short unsigned int* w = outWords + j * MAX_WORD_LENGTH;
char s[MAX_WORD_LENGTH];
for (int i = 0; i <= MAX_WORD_LENGTH; i++) s[i] = w[i];
+ (void)s;
AKLOGI("%s %i", s, frequencies[j]);
}
}
@@ -503,8 +504,12 @@ bool UnigramDictionary::getSubStringSuggestion(
freqArray, wordLengthArray, currentWordIndex + 1, isSpaceProximity, outputWord);
if (DEBUG_DICT) {
DUMP_WORD(outputWord, tempOutputWordLength);
- AKLOGI("Split two words: %d, %d, %d, %d, (%d) %d", freqArray[0], freqArray[1], pairFreq,
- inputLength, wordLengthArray[0], tempOutputWordLength);
+ for (int i = 0; i < currentWordIndex + 1; ++i) {
+ AKLOGI("Split %d,%d words: freq = %d, length = %d", i, currentWordIndex + 1,
+ freqArray[i], wordLengthArray[i]);
+ }
+ AKLOGI("Split two words: freq = %d, length = %d, %d, isSpace ? %d", pairFreq,
+ inputLength, tempOutputWordLength, isSpaceProximity);
}
addWord(outputWord, tempOutputWordLength, pairFreq, queuePool->getMasterQueue());
}