am a0ea92f7: Remove mPartiallyCommited.

* commit 'a0ea92f76c2e73e4b4bbb59680bc6cd3c33f0573':
  Remove mPartiallyCommited.
main
Keisuke Kuroyanagi 2014-03-28 11:52:17 +00:00 committed by Android Git Automerger
commit 8118a19906
3 changed files with 4 additions and 13 deletions

View File

@ -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 // Force autocorrection for obvious long multi-word suggestions when the top suggestion is
// a long multiple words suggestion. // a long multiple words suggestion.
// TODO: Implement a smarter auto-commit method for handling multi-word suggestions. // TODO: Implement a smarter auto-commit method for handling multi-word suggestions.
// traverseSession->isPartiallyCommited() always returns false because we never auto partial const bool forceCommitMultiWords = scoringPolicy->autoCorrectsToMultiWordSuggestionIfTop()
// commit for now. && (traverseSession->getInputSize() >= MIN_LEN_FOR_MULTI_WORD_AUTOCORRECT
const bool forceCommitMultiWords = (terminalSize > 0) ? && terminals[0].hasMultipleWords());
scoringPolicy->autoCorrectsToMultiWordSuggestionIfTop()
&& (traverseSession->isPartiallyCommited()
|| (traverseSession->getInputSize()
>= MIN_LEN_FOR_MULTI_WORD_AUTOCORRECT
&& terminals[0].hasMultipleWords())) : false;
// TODO: have partial commit work even with multiple pointers. // TODO: have partial commit work even with multiple pointers.
const bool outputSecondWordFirstLetterInputIndex = const bool outputSecondWordFirstLetterInputIndex =
traverseSession->isOnlyOnePointerUsed(0 /* pointerId */); traverseSession->isOnlyOnePointerUsed(0 /* pointerId */);

View File

@ -68,7 +68,6 @@ void DicTraverseSession::resetCache(const int thresholdForNextActiveDicNodes, co
mDicNodesCache.reset(thresholdForNextActiveDicNodes /* nextActiveSize */, mDicNodesCache.reset(thresholdForNextActiveDicNodes /* nextActiveSize */,
maxWords /* terminalSize */); maxWords /* terminalSize */);
mMultiBigramMap.clear(); mMultiBigramMap.clear();
mPartiallyCommited = false;
} }
void DicTraverseSession::initializeProximityInfoStates(const int *const inputCodePoints, void DicTraverseSession::initializeProximityInfoStates(const int *const inputCodePoints,

View File

@ -61,7 +61,7 @@ class DicTraverseSession {
AK_FORCE_INLINE DicTraverseSession(JNIEnv *env, jstring localeStr, bool usesLargeCache) AK_FORCE_INLINE DicTraverseSession(JNIEnv *env, jstring localeStr, bool usesLargeCache)
: mPrevWordPtNodePos(NOT_A_DICT_POS), mProximityInfo(nullptr), : mPrevWordPtNodePos(NOT_A_DICT_POS), mProximityInfo(nullptr),
mDictionary(nullptr), mSuggestOptions(nullptr), mDicNodesCache(usesLargeCache), mDictionary(nullptr), mSuggestOptions(nullptr), mDicNodesCache(usesLargeCache),
mMultiBigramMap(), mInputSize(0), mPartiallyCommited(false), mMaxPointerCount(1), mMultiBigramMap(), mInputSize(0), mMaxPointerCount(1),
mMultiWordCostMultiplier(1.0f) { mMultiWordCostMultiplier(1.0f) {
// NOTE: mProximityInfoStates is an array of instances. // NOTE: mProximityInfoStates is an array of instances.
// No need to initialize it explicitly here. // No need to initialize it explicitly here.
@ -95,8 +95,6 @@ class DicTraverseSession {
return &mProximityInfoStates[id]; return &mProximityInfoStates[id];
} }
int getInputSize() const { return mInputSize; } int getInputSize() const { return mInputSize; }
void setPartiallyCommited() { mPartiallyCommited = true; }
bool isPartiallyCommited() const { return mPartiallyCommited; }
bool isOnlyOnePointerUsed(int *pointerId) const { bool isOnlyOnePointerUsed(int *pointerId) const {
// Not in the dictionary word // Not in the dictionary word
@ -188,7 +186,6 @@ class DicTraverseSession {
ProximityInfoState mProximityInfoStates[MAX_POINTER_COUNT_G]; ProximityInfoState mProximityInfoStates[MAX_POINTER_COUNT_G];
int mInputSize; int mInputSize;
bool mPartiallyCommited;
int mMaxPointerCount; int mMaxPointerCount;
///////////////////////////////// /////////////////////////////////