am ed378c78: Auto-correct without whitelist in Delight3.
* commit 'ed378c78a15757c7386d84c6cd7470d56ed00c76': Auto-correct without whitelist in Delight3.main
commit
6e8c45a4da
|
@ -33,4 +33,5 @@ public class DecoderSpecificConstants {
|
||||||
public static final boolean SHOULD_VERIFY_MAGIC_NUMBER = true;
|
public static final boolean SHOULD_VERIFY_MAGIC_NUMBER = true;
|
||||||
public static final boolean SHOULD_VERIFY_CHECKSUM = true;
|
public static final boolean SHOULD_VERIFY_CHECKSUM = true;
|
||||||
public static final boolean SHOULD_USE_DICT_VERSION = true;
|
public static final boolean SHOULD_USE_DICT_VERSION = true;
|
||||||
|
public static final boolean SHOULD_AUTO_CORRECT_USING_NON_WHITE_LISTED_SUGGESTION = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@ package com.android.inputmethod.latin;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import static com.android.inputmethod.latin.define.DecoderSpecificConstants.SHOULD_AUTO_CORRECT_USING_NON_WHITE_LISTED_SUGGESTION;
|
||||||
|
|
||||||
import com.android.inputmethod.keyboard.KeyboardLayout;
|
import com.android.inputmethod.keyboard.KeyboardLayout;
|
||||||
import com.android.inputmethod.keyboard.ProximityInfo;
|
import com.android.inputmethod.keyboard.ProximityInfo;
|
||||||
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
|
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
|
||||||
|
@ -236,10 +238,11 @@ public final class Suggest {
|
||||||
}
|
}
|
||||||
final boolean resultsArePredictions = !wordComposer.isComposingWord();
|
final boolean resultsArePredictions = !wordComposer.isComposingWord();
|
||||||
|
|
||||||
// We allow auto-correction if we have a whitelisted word, or if the word had more than
|
// We allow auto-correction if whitelisting is not required or the word is whitelisted,
|
||||||
// one char and was not suggested.
|
// or if the word had more than one char and was not suggested.
|
||||||
final boolean allowsToBeAutoCorrected = (null != whitelistedWord)
|
final boolean allowsToBeAutoCorrected =
|
||||||
|| (consideredWord.length() > 1 && (null == sourceDictionaryOfRemovedWord));
|
(SHOULD_AUTO_CORRECT_USING_NON_WHITE_LISTED_SUGGESTION || whitelistedWord != null)
|
||||||
|
|| (consideredWord.length() > 1 && (sourceDictionaryOfRemovedWord == null));
|
||||||
|
|
||||||
final boolean hasAutoCorrection;
|
final boolean hasAutoCorrection;
|
||||||
// If correction is not enabled, we never auto-correct. This is for example for when
|
// If correction is not enabled, we never auto-correct. This is for example for when
|
||||||
|
|
Loading…
Reference in New Issue