mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
[CB24] Remove a useless test
If 1 character, then for sure !isGesture Bug: 13406701 Change-Id: If8e9b080372eb8ddb15b8f97cce1399dc0c7f099
This commit is contained in:
parent
36dfb6d1a4
commit
45e34b4374
@ -253,18 +253,20 @@ public final class BinaryDictionary extends Dictionary {
|
|||||||
// TODO: toLowerCase in the native code
|
// TODO: toLowerCase in the native code
|
||||||
final int[] prevWordCodePointArray = (null == prevWord)
|
final int[] prevWordCodePointArray = (null == prevWord)
|
||||||
? null : StringUtils.toCodePointArray(prevWord);
|
? null : StringUtils.toCodePointArray(prevWord);
|
||||||
final int composerSize = composer.sizeWithoutTrailingSingleQuotes();
|
final InputPointers inputPointers = composer.getInputPointers();
|
||||||
|
|
||||||
final boolean isGesture = composer.isBatchMode();
|
final boolean isGesture = composer.isBatchMode();
|
||||||
if (composerSize <= 1 || !isGesture) {
|
final int inputSize;
|
||||||
|
if (!isGesture) {
|
||||||
|
final int composerSize = composer.sizeWithoutTrailingSingleQuotes();
|
||||||
if (composerSize > MAX_WORD_LENGTH - 1) return null;
|
if (composerSize > MAX_WORD_LENGTH - 1) return null;
|
||||||
for (int i = 0; i < composerSize; i++) {
|
for (int i = 0; i < composerSize; i++) {
|
||||||
mInputCodePoints[i] = composer.getCodeAt(i);
|
mInputCodePoints[i] = composer.getCodeAt(i);
|
||||||
}
|
}
|
||||||
|
inputSize = composerSize;
|
||||||
|
} else {
|
||||||
|
inputSize = inputPointers.getPointerSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
final InputPointers ips = composer.getInputPointers();
|
|
||||||
final int inputSize = isGesture ? ips.getPointerSize() : composerSize;
|
|
||||||
mNativeSuggestOptions.setIsGesture(isGesture);
|
mNativeSuggestOptions.setIsGesture(isGesture);
|
||||||
mNativeSuggestOptions.setAdditionalFeaturesOptions(additionalFeaturesOptions);
|
mNativeSuggestOptions.setAdditionalFeaturesOptions(additionalFeaturesOptions);
|
||||||
if (inOutLanguageWeight != null) {
|
if (inOutLanguageWeight != null) {
|
||||||
@ -274,12 +276,12 @@ public final class BinaryDictionary extends Dictionary {
|
|||||||
}
|
}
|
||||||
// proximityInfo and/or prevWordForBigrams may not be null.
|
// proximityInfo and/or prevWordForBigrams may not be null.
|
||||||
getSuggestionsNative(mNativeDict, proximityInfo.getNativeProximityInfo(),
|
getSuggestionsNative(mNativeDict, proximityInfo.getNativeProximityInfo(),
|
||||||
getTraverseSession(sessionId).getSession(), ips.getXCoordinates(),
|
getTraverseSession(sessionId).getSession(), inputPointers.getXCoordinates(),
|
||||||
ips.getYCoordinates(), ips.getTimes(), ips.getPointerIds(), mInputCodePoints,
|
inputPointers.getYCoordinates(), inputPointers.getTimes(),
|
||||||
inputSize, mNativeSuggestOptions.getOptions(),
|
inputPointers.getPointerIds(), mInputCodePoints, inputSize,
|
||||||
prevWordCodePointArray, mOutputSuggestionCount, mOutputCodePoints, mOutputScores,
|
mNativeSuggestOptions.getOptions(), prevWordCodePointArray, mOutputSuggestionCount,
|
||||||
mSpaceIndices, mOutputTypes, mOutputAutoCommitFirstWordConfidence,
|
mOutputCodePoints, mOutputScores, mSpaceIndices, mOutputTypes,
|
||||||
mInputOutputLanguageWeight);
|
mOutputAutoCommitFirstWordConfidence, mInputOutputLanguageWeight);
|
||||||
if (inOutLanguageWeight != null) {
|
if (inOutLanguageWeight != null) {
|
||||||
inOutLanguageWeight[0] = mInputOutputLanguageWeight[0];
|
inOutLanguageWeight[0] = mInputOutputLanguageWeight[0];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user