Make AutoCorrection static and non-instantiable (A5)
This needs change Ic6756baa to not break the build Change-Id: I1c772dd99d63fec5d3ad67a0eb7fbc28ec7a0f0f
This commit is contained in:
parent
7a580a4769
commit
82adfdaeae
2 changed files with 6 additions and 5 deletions
|
@ -26,7 +26,11 @@ public class AutoCorrection {
|
|||
private static final boolean DBG = LatinImeLogger.sDBG;
|
||||
private static final String TAG = AutoCorrection.class.getSimpleName();
|
||||
|
||||
public static CharSequence updateAutoCorrectionStatus(Map<String, Dictionary> dictionaries,
|
||||
private AutoCorrection() {
|
||||
// Purely static class: can't instantiate.
|
||||
}
|
||||
|
||||
public static CharSequence computeAutoCorrectionWord(Map<String, Dictionary> dictionaries,
|
||||
WordComposer wordComposer, ArrayList<CharSequence> suggestions, int[] sortedScores,
|
||||
CharSequence typedWord, double autoCorrectionThreshold, int correctionMode,
|
||||
CharSequence whitelistedWord) {
|
||||
|
|
|
@ -83,7 +83,6 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
|
||||
private static final boolean DBG = LatinImeLogger.sDBG;
|
||||
|
||||
private AutoCorrection mAutoCorrection;
|
||||
private boolean mHasAutoCorrection;
|
||||
|
||||
private Dictionary mMainDict;
|
||||
|
@ -123,7 +122,6 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
private void initWhitelistAndAutocorrectAndPool(final Context context, final Locale locale) {
|
||||
mWhiteListDictionary = new WhitelistDictionary(context, locale);
|
||||
addOrReplaceDictionary(mUnigramDictionaries, DICT_KEY_WHITELIST, mWhiteListDictionary);
|
||||
mAutoCorrection = new AutoCorrection();
|
||||
StringBuilderPool.ensureCapacity(mPrefMaxSuggestions, getApproxMaxWordLength());
|
||||
}
|
||||
|
||||
|
@ -285,7 +283,6 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
final WordComposer wordComposer, CharSequence prevWordForBigram,
|
||||
final ProximityInfo proximityInfo, final int correctionMode) {
|
||||
LatinImeLogger.onStartSuggestion(prevWordForBigram);
|
||||
mAutoCorrection.init();
|
||||
mIsFirstCharCapitalized = wordComposer.isFirstCharCapitalized();
|
||||
mIsAllUpperCase = wordComposer.isAllUpperCase();
|
||||
mTrailingSingleQuotesCount = wordComposer.trailingSingleQuotesCount();
|
||||
|
@ -366,7 +363,7 @@ public class Suggest implements Dictionary.WordCallback {
|
|||
mWhiteListDictionary.getWhitelistedWord(consideredWordString));
|
||||
|
||||
final CharSequence autoCorrection =
|
||||
mAutoCorrection.updateAutoCorrectionStatus(mUnigramDictionaries, wordComposer,
|
||||
AutoCorrection.computeAutoCorrectionWord(mUnigramDictionaries, wordComposer,
|
||||
mSuggestions, mScores, consideredWord, mAutoCorrectionThreshold, correctionMode,
|
||||
whitelistedWord);
|
||||
mHasAutoCorrection = (null != autoCorrection);
|
||||
|
|
Loading…
Reference in a new issue