am 82ddd168: Stop avoiding adding what the user typed to candidates

* commit '82ddd168893892cfe4366e1e2fa9e9bfeb5478a5':
  Stop avoiding adding what the user typed to candidates
main
Jean Chalard 2012-01-16 02:12:19 -08:00 committed by Android Git Automerger
commit 93e154715c
3 changed files with 4 additions and 3 deletions

View File

@ -168,8 +168,8 @@ int Correction::getFinalFreq(const int freq, unsigned short **word, int *wordLen
const int outputIndex = mTerminalOutputIndex; const int outputIndex = mTerminalOutputIndex;
const int inputIndex = mTerminalInputIndex; const int inputIndex = mTerminalInputIndex;
*wordLength = outputIndex + 1; *wordLength = outputIndex + 1;
if (mProximityInfo->sameAsTyped(mWord, outputIndex + 1) || outputIndex < MIN_SUGGEST_DEPTH) { if (outputIndex < MIN_SUGGEST_DEPTH) {
return -1; return NOT_A_FREQUENCY;
} }
*word = mWord; *word = mWord;

View File

@ -172,6 +172,7 @@ static void prof_out(void) {
#define EQUIVALENT_CHAR_WITHOUT_DISTANCE_INFO -2 #define EQUIVALENT_CHAR_WITHOUT_DISTANCE_INFO -2
#define PROXIMITY_CHAR_WITHOUT_DISTANCE_INFO -3 #define PROXIMITY_CHAR_WITHOUT_DISTANCE_INFO -3
#define NOT_A_INDEX -1 #define NOT_A_INDEX -1
#define NOT_A_FREQUENCY -1
#define KEYCODE_SPACE ' ' #define KEYCODE_SPACE ' '

View File

@ -335,7 +335,7 @@ inline void UnigramDictionary::onTerminal(const int freq,
int wordLength; int wordLength;
unsigned short* wordPointer; unsigned short* wordPointer;
const int finalFreq = correction->getFinalFreq(freq, &wordPointer, &wordLength); const int finalFreq = correction->getFinalFreq(freq, &wordPointer, &wordLength);
if (finalFreq >= 0) { if (finalFreq != NOT_A_FREQUENCY) {
if (!terminalAttributes.isShortcutOnly()) { if (!terminalAttributes.isShortcutOnly()) {
if (addToMasterQueue) { if (addToMasterQueue) {
addWord(wordPointer, wordLength, finalFreq, masterQueue); addWord(wordPointer, wordLength, finalFreq, masterQueue);