diff options
author | 2009-12-18 13:39:18 -0800 | |
---|---|---|
committer | 2009-12-18 14:32:48 -0800 | |
commit | e8f1edefeb2375a253d742c7f95e8d91677c7073 (patch) | |
tree | 6b6024e11c187921615954e0c36e619ae41f737d /dictionary/jni/com_android_inputmethod_latin_BinaryDictionary.cpp | |
parent | 646ca037e733e52f300eac9bb266dc6b0328e5a2 (diff) | |
download | latinime-e8f1edefeb2375a253d742c7f95e8d91677c7073.tar.gz latinime-e8f1edefeb2375a253d742c7f95e8d91677c7073.tar.xz latinime-e8f1edefeb2375a253d742c7f95e8d91677c7073.zip |
Enable auto-correction only if there is a significant size main dictionary.
Added e-umlaut popup for Russian keyboard.
Added a French Canadian string resource but wont help until we add fr_CA to
the supported locales list.
Diffstat (limited to 'dictionary/jni/com_android_inputmethod_latin_BinaryDictionary.cpp')
-rw-r--r-- | dictionary/jni/com_android_inputmethod_latin_BinaryDictionary.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dictionary/jni/com_android_inputmethod_latin_BinaryDictionary.cpp b/dictionary/jni/com_android_inputmethod_latin_BinaryDictionary.cpp index c9e158c4c..3076085e4 100644 --- a/dictionary/jni/com_android_inputmethod_latin_BinaryDictionary.cpp +++ b/dictionary/jni/com_android_inputmethod_latin_BinaryDictionary.cpp @@ -38,6 +38,7 @@ using namespace android; static jfieldID sDescriptorField; static jfieldID sAssetManagerNativeField; static jmethodID sAddWordMethod; +static jfieldID sDictLength; // // helper function to throw an exception @@ -79,6 +80,7 @@ static jint latinime_BinaryDictionary_open } Dictionary *dictionary = new Dictionary(dict, typedLetterMultiplier, fullWordMultiplier); dictionary->setAsset(dictAsset); + env->SetIntField(object, sDictLength, (jint) dictAsset->getLength()); env->ReleaseStringUTFChars(resourceString, resourcePath); return (jint) dictionary; @@ -176,6 +178,14 @@ static int registerNatives(JNIEnv *env) } sAssetManagerNativeField = env->GetFieldID(clazz, "mObject", "I"); + // Get the field pointer for the dictionary length + clazz = env->FindClass(kClassPathName); + if (clazz == NULL) { + LOGE("Can't find %s", kClassPathName); + return -1; + } + sDictLength = env->GetFieldID(clazz, "mDictLength", "I"); + return registerNativeMethods(env, kClassPathName, gMethods, sizeof(gMethods) / sizeof(gMethods[0])); } |