Remove mPartiallyCommited.
Bug: 13333066 Change-Id: I4e3aa31aa501866c23cc4b86093b866306161bfd
This commit is contained in:
parent
452cd2f619
commit
a0ea92f76c
3 changed files with 4 additions and 13 deletions
|
@ -52,14 +52,9 @@ const int SuggestionsOutputUtils::MIN_LEN_FOR_MULTI_WORD_AUTOCORRECT = 16;
|
|||
// Force autocorrection for obvious long multi-word suggestions when the top suggestion is
|
||||
// a long multiple words suggestion.
|
||||
// TODO: Implement a smarter auto-commit method for handling multi-word suggestions.
|
||||
// traverseSession->isPartiallyCommited() always returns false because we never auto partial
|
||||
// commit for now.
|
||||
const bool forceCommitMultiWords = (terminalSize > 0) ?
|
||||
scoringPolicy->autoCorrectsToMultiWordSuggestionIfTop()
|
||||
&& (traverseSession->isPartiallyCommited()
|
||||
|| (traverseSession->getInputSize()
|
||||
>= MIN_LEN_FOR_MULTI_WORD_AUTOCORRECT
|
||||
&& terminals[0].hasMultipleWords())) : false;
|
||||
const bool forceCommitMultiWords = scoringPolicy->autoCorrectsToMultiWordSuggestionIfTop()
|
||||
&& (traverseSession->getInputSize() >= MIN_LEN_FOR_MULTI_WORD_AUTOCORRECT
|
||||
&& terminals[0].hasMultipleWords());
|
||||
// TODO: have partial commit work even with multiple pointers.
|
||||
const bool outputSecondWordFirstLetterInputIndex =
|
||||
traverseSession->isOnlyOnePointerUsed(0 /* pointerId */);
|
||||
|
|
|
@ -68,7 +68,6 @@ void DicTraverseSession::resetCache(const int thresholdForNextActiveDicNodes, co
|
|||
mDicNodesCache.reset(thresholdForNextActiveDicNodes /* nextActiveSize */,
|
||||
maxWords /* terminalSize */);
|
||||
mMultiBigramMap.clear();
|
||||
mPartiallyCommited = false;
|
||||
}
|
||||
|
||||
void DicTraverseSession::initializeProximityInfoStates(const int *const inputCodePoints,
|
||||
|
|
|
@ -61,7 +61,7 @@ class DicTraverseSession {
|
|||
AK_FORCE_INLINE DicTraverseSession(JNIEnv *env, jstring localeStr, bool usesLargeCache)
|
||||
: mPrevWordPtNodePos(NOT_A_DICT_POS), mProximityInfo(nullptr),
|
||||
mDictionary(nullptr), mSuggestOptions(nullptr), mDicNodesCache(usesLargeCache),
|
||||
mMultiBigramMap(), mInputSize(0), mPartiallyCommited(false), mMaxPointerCount(1),
|
||||
mMultiBigramMap(), mInputSize(0), mMaxPointerCount(1),
|
||||
mMultiWordCostMultiplier(1.0f) {
|
||||
// NOTE: mProximityInfoStates is an array of instances.
|
||||
// No need to initialize it explicitly here.
|
||||
|
@ -95,8 +95,6 @@ class DicTraverseSession {
|
|||
return &mProximityInfoStates[id];
|
||||
}
|
||||
int getInputSize() const { return mInputSize; }
|
||||
void setPartiallyCommited() { mPartiallyCommited = true; }
|
||||
bool isPartiallyCommited() const { return mPartiallyCommited; }
|
||||
|
||||
bool isOnlyOnePointerUsed(int *pointerId) const {
|
||||
// Not in the dictionary word
|
||||
|
@ -188,7 +186,6 @@ class DicTraverseSession {
|
|||
ProximityInfoState mProximityInfoStates[MAX_POINTER_COUNT_G];
|
||||
|
||||
int mInputSize;
|
||||
bool mPartiallyCommited;
|
||||
int mMaxPointerCount;
|
||||
|
||||
/////////////////////////////////
|
||||
|
|
Loading…
Reference in a new issue