Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe9ec6bc authored by Ken Wakasa's avatar Ken Wakasa
Browse files

Remove unused variables

Change-Id: Ia5079368a1bc86ccdf0052445dc6945041c0abca
parent f25cc440
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ public final class BinaryDictionary extends Dictionary {
    }

    private native long openNative(String sourceDir, long dictOffset, long dictSize,
            int fullWordMultiplier, int maxWordLength, int maxWords, int maxPredictions);
            int maxWordLength, int maxWords, int maxPredictions);
    private native void closeNative(long dict);
    private native int getFrequencyNative(long dict, int[] word);
    private native boolean isValidBigramNative(long dict, int[] word1, int[] word2);
@@ -116,8 +116,8 @@ public final class BinaryDictionary extends Dictionary {
    // TODO: Move native dict into session
    private final void loadDictionary(final String path, final long startOffset,
            final long length) {
        mNativeDict = openNative(path, startOffset, length, FULL_WORD_SCORE_MULTIPLIER,
                MAX_WORD_LENGTH, MAX_WORDS, MAX_PREDICTIONS);
        mNativeDict = openNative(path, startOffset, length, MAX_WORD_LENGTH, MAX_WORDS,
                MAX_PREDICTIONS);
    }

    @Override
+0 −5
Original line number Diff line number Diff line
@@ -26,11 +26,6 @@ import java.util.ArrayList;
 * strokes.
 */
public abstract class Dictionary {
    /**
     * The weight to give to a word if it's length is the same as the number of typed characters.
     */
    protected static final int FULL_WORD_SCORE_MULTIPLIER = 2;

    public static final int NOT_A_PROBABILITY = -1;

    public static final String TYPE_USER_TYPED = "user_typed";
+4 −0
Original line number Diff line number Diff line
@@ -31,6 +31,10 @@ import java.util.LinkedList;
 * be searched for suggestions and valid words.
 */
public class ExpandableDictionary extends Dictionary {
    /**
     * The weight to give to a word if it's length is the same as the number of typed characters.
     */
    private static final int FULL_WORD_SCORE_MULTIPLIER = 2;

    // Bigram frequency is a fixed point number with 1 meaning 1.2 and 255 meaning 1.8.
    protected static final int BIGRAM_MAX_FREQUENCY = 255;
+5 −6
Original line number Diff line number Diff line
@@ -43,9 +43,8 @@ class ProximityInfo;

static void releaseDictBuf(const void *dictBuf, const size_t length, const int fd);

static jlong latinime_BinaryDictionary_open(JNIEnv *env, jobject object,
        jstring sourceDir, jlong dictOffset, jlong dictSize, jint fullWordMultiplier,
        jint maxWordLength, jint maxWords, jint maxPredictions) {
static jlong latinime_BinaryDictionary_open(JNIEnv *env, jobject object, jstring sourceDir,
        jlong dictOffset, jlong dictSize, jint maxWordLength, jint maxWords, jint maxPredictions) {
    PROF_OPEN;
    PROF_START(66);
    const jsize sourceDirUtf8Length = env->GetStringUTFLength(sourceDir);
@@ -119,8 +118,8 @@ static jlong latinime_BinaryDictionary_open(JNIEnv *env, jobject object,
        releaseDictBuf(dictBuf, 0, 0);
#endif // USE_MMAP_FOR_DICTIONARY
    } else {
        dictionary = new Dictionary(dictBuf, static_cast<int>(dictSize), fd, adjust,
                fullWordMultiplier, maxWordLength, maxWords, maxPredictions);
        dictionary = new Dictionary(dictBuf, static_cast<int>(dictSize), fd, adjust, maxWordLength,
                maxWords, maxPredictions);
    }
    PROF_END(66);
    PROF_CLOSE;
@@ -272,7 +271,7 @@ static void releaseDictBuf(const void *dictBuf, const size_t length, const int f
}

static JNINativeMethod sMethods[] = {
    {"openNative", "(Ljava/lang/String;JJIIII)J",
    {"openNative", "(Ljava/lang/String;JJIII)J",
            reinterpret_cast<void *>(latinime_BinaryDictionary_open)},
    {"closeNative", "(J)V", reinterpret_cast<void *>(latinime_BinaryDictionary_close)},
    {"getSuggestionsNative", "(JJJ[I[I[I[I[IIIZ[IZ[I[I[I[I)I",
+4 −4
Original line number Diff line number Diff line
@@ -29,13 +29,13 @@
namespace latinime {

// TODO: Change the type of all keyCodes to uint32_t
Dictionary::Dictionary(void *dict, int dictSize, int mmapFd, int dictBufAdjust,
        int fullWordMultiplier, int maxWordLength, int maxWords, int maxPredictions)
Dictionary::Dictionary(void *dict, int dictSize, int mmapFd, int dictBufAdjust, int maxWordLength,
        int maxWords, int maxPredictions)
        : mDict(static_cast<unsigned char *>(dict)),
          mOffsetDict((static_cast<unsigned char *>(dict)) + BinaryFormat::getHeaderSize(mDict)),
          mDictSize(dictSize), mMmapFd(mmapFd), mDictBufAdjust(dictBufAdjust),
          mUnigramDictionary(new UnigramDictionary(mOffsetDict, fullWordMultiplier, maxWordLength,
                  maxWords, BinaryFormat::getFlags(mDict))),
          mUnigramDictionary(new UnigramDictionary(mOffsetDict, maxWordLength, maxWords,
                  BinaryFormat::getFlags(mDict))),
          mBigramDictionary(new BigramDictionary(mOffsetDict, maxWordLength, maxPredictions)),
          mGestureDecoder(new GestureDecoderWrapper(maxWordLength, maxWords)) {
    if (DEBUG_DICT) {
Loading