am 77a34f2e: am e2ac3932: Merge "Allow one-character suggestions." into jb-mr1-dev
* commit '77a34f2e49b5f7bf04ef22414c7a09f78a78afba': Allow one-character suggestions.main
commit
667108d71d
|
@ -178,7 +178,7 @@ static int latinime_BinaryDictionary_getSuggestions(JNIEnv *env, jobject object,
|
||||||
memset(outputTypes, 0, outputTypesLength * sizeof(outputTypes[0]));
|
memset(outputTypes, 0, outputTypesLength * sizeof(outputTypes[0]));
|
||||||
|
|
||||||
int count;
|
int count;
|
||||||
if (isGesture || arraySize > 1) {
|
if (isGesture || arraySize > 0) {
|
||||||
count = dictionary->getSuggestions(pInfo, traverseSession, xCoordinates, yCoordinates,
|
count = dictionary->getSuggestions(pInfo, traverseSession, xCoordinates, yCoordinates,
|
||||||
times, pointerIds, inputCodePoints, arraySize, prevWordCodePoints,
|
times, pointerIds, inputCodePoints, arraySize, prevWordCodePoints,
|
||||||
prevWordCodePointsLength, commitPoint, isGesture, useFullEditDistance, outputChars,
|
prevWordCodePointsLength, commitPoint, isGesture, useFullEditDistance, outputChars,
|
||||||
|
|
|
@ -181,10 +181,6 @@ int Correction::getFinalProbabilityInternal(const int probability, unsigned shor
|
||||||
const int outputIndex = mTerminalOutputIndex;
|
const int outputIndex = mTerminalOutputIndex;
|
||||||
const int inputIndex = mTerminalInputIndex;
|
const int inputIndex = mTerminalInputIndex;
|
||||||
*wordLength = outputIndex + 1;
|
*wordLength = outputIndex + 1;
|
||||||
if (outputIndex < MIN_SUGGEST_DEPTH) {
|
|
||||||
return NOT_A_PROBABILITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
*word = mWord;
|
*word = mWord;
|
||||||
int finalProbability= Correction::RankingAlgorithm::calculateFinalProbability(
|
int finalProbability= Correction::RankingAlgorithm::calculateFinalProbability(
|
||||||
inputIndex, outputIndex, probability, mEditDistanceTable, this, inputLength);
|
inputIndex, outputIndex, probability, mEditDistanceTable, this, inputLength);
|
||||||
|
|
|
@ -298,8 +298,6 @@ static inline void prof_out(void) {
|
||||||
// word in the dictionary for languages with digraphs, like German and French
|
// word in the dictionary for languages with digraphs, like German and French
|
||||||
#define DEFAULT_MAX_DIGRAPH_SEARCH_DEPTH 5
|
#define DEFAULT_MAX_DIGRAPH_SEARCH_DEPTH 5
|
||||||
|
|
||||||
// Minimum suggest depth for one word for all cases except for missing space suggestions.
|
|
||||||
#define MIN_SUGGEST_DEPTH 1
|
|
||||||
#define MIN_USER_TYPED_LENGTH_FOR_MULTIPLE_WORD_SUGGESTION 3
|
#define MIN_USER_TYPED_LENGTH_FOR_MULTIPLE_WORD_SUGGESTION 3
|
||||||
#define MIN_USER_TYPED_LENGTH_FOR_EXCESSIVE_CHARACTER_SUGGESTION 3
|
#define MIN_USER_TYPED_LENGTH_FOR_EXCESSIVE_CHARACTER_SUGGESTION 3
|
||||||
|
|
||||||
|
|
|
@ -390,7 +390,7 @@ inline void UnigramDictionary::onTerminal(const int probability,
|
||||||
WordsPriorityQueue *masterQueue = queuePool->getMasterQueue();
|
WordsPriorityQueue *masterQueue = queuePool->getMasterQueue();
|
||||||
const int finalProbability =
|
const int finalProbability =
|
||||||
correction->getFinalProbability(probability, &wordPointer, &wordLength);
|
correction->getFinalProbability(probability, &wordPointer, &wordLength);
|
||||||
if (finalProbability != NOT_A_PROBABILITY) {
|
|
||||||
if (0 != finalProbability) {
|
if (0 != finalProbability) {
|
||||||
// If the probability is 0, we don't want to add this word. However we still
|
// If the probability is 0, we don't want to add this word. However we still
|
||||||
// want to add its shortcuts (including a possible whitelist entry) if any.
|
// want to add its shortcuts (including a possible whitelist entry) if any.
|
||||||
|
@ -428,7 +428,6 @@ inline void UnigramDictionary::onTerminal(const int probability,
|
||||||
masterQueue, kind);
|
masterQueue, kind);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// We only allow two words + other error correction for words with SUB_QUEUE_MIN_WORD_LENGTH
|
// We only allow two words + other error correction for words with SUB_QUEUE_MIN_WORD_LENGTH
|
||||||
// or more length.
|
// or more length.
|
||||||
|
|
Loading…
Reference in New Issue