"much" in suggestions of "m" after "very"
Make cache size larger for single point input. Bug: 9823678 Change-Id: Ic6bbcebd18eccaf9f9ac07d9c0d456a62f6c5287
This commit is contained in:
parent
ffcbbaf127
commit
4447b14b78
6 changed files with 10 additions and 5 deletions
|
@ -24,7 +24,8 @@
|
||||||
#include "suggest/core/dicnode/dic_node.h"
|
#include "suggest/core/dicnode/dic_node.h"
|
||||||
#include "suggest/core/dicnode/dic_node_release_listener.h"
|
#include "suggest/core/dicnode/dic_node_release_listener.h"
|
||||||
|
|
||||||
#define MAX_DIC_NODE_PRIORITY_QUEUE_CAPACITY 200
|
// The biggest value among MAX_CACHE_DIC_NODE_SIZE, MAX_CACHE_DIC_NODE_SIZE_FOR_SINGLE_POINT, ...
|
||||||
|
#define MAX_DIC_NODE_PRIORITY_QUEUE_CAPACITY 310
|
||||||
|
|
||||||
namespace latinime {
|
namespace latinime {
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Traversal {
|
||||||
virtual float getMaxSpatialDistance() const = 0;
|
virtual float getMaxSpatialDistance() const = 0;
|
||||||
virtual bool autoCorrectsToMultiWordSuggestionIfTop() const = 0;
|
virtual bool autoCorrectsToMultiWordSuggestionIfTop() const = 0;
|
||||||
virtual int getDefaultExpandDicNodeSize() const = 0;
|
virtual int getDefaultExpandDicNodeSize() const = 0;
|
||||||
virtual int getMaxCacheSize() const = 0;
|
virtual int getMaxCacheSize(const int inputSize) const = 0;
|
||||||
virtual bool isPossibleOmissionChildNode(const DicTraverseSession *const traverseSession,
|
virtual bool isPossibleOmissionChildNode(const DicTraverseSession *const traverseSession,
|
||||||
const DicNode *const parentDicNode, const DicNode *const dicNode) const = 0;
|
const DicNode *const parentDicNode, const DicNode *const dicNode) const = 0;
|
||||||
virtual bool isGoodToTraverseNextWord(const DicNode *const dicNode) const = 0;
|
virtual bool isGoodToTraverseNextWord(const DicNode *const dicNode) const = 0;
|
||||||
|
|
|
@ -103,7 +103,8 @@ void Suggest::initializeSearch(DicTraverseSession *traverseSession, int commitPo
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Restart recognition at the root.
|
// Restart recognition at the root.
|
||||||
traverseSession->resetCache(TRAVERSAL->getMaxCacheSize(), MAX_RESULTS);
|
traverseSession->resetCache(TRAVERSAL->getMaxCacheSize(traverseSession->getInputSize()),
|
||||||
|
MAX_RESULTS);
|
||||||
// Create a new dic node here
|
// Create a new dic node here
|
||||||
DicNode rootNode;
|
DicNode rootNode;
|
||||||
DicNodeUtils::initAsRoot(traverseSession->getBinaryDictionaryInfo(),
|
DicNodeUtils::initAsRoot(traverseSession->getBinaryDictionaryInfo(),
|
||||||
|
|
|
@ -24,6 +24,7 @@ const int ScoringParams::THRESHOLD_NEXT_WORD_PROBABILITY_FOR_CAPPED = 120;
|
||||||
const float ScoringParams::AUTOCORRECT_OUTPUT_THRESHOLD = 1.0f;
|
const float ScoringParams::AUTOCORRECT_OUTPUT_THRESHOLD = 1.0f;
|
||||||
// TODO: Unlimit max cache dic node size
|
// TODO: Unlimit max cache dic node size
|
||||||
const int ScoringParams::MAX_CACHE_DIC_NODE_SIZE = 170;
|
const int ScoringParams::MAX_CACHE_DIC_NODE_SIZE = 170;
|
||||||
|
const int ScoringParams::MAX_CACHE_DIC_NODE_SIZE_FOR_SINGLE_POINT = 310;
|
||||||
const int ScoringParams::THRESHOLD_SHORT_WORD_LENGTH = 4;
|
const int ScoringParams::THRESHOLD_SHORT_WORD_LENGTH = 4;
|
||||||
|
|
||||||
const float ScoringParams::DISTANCE_WEIGHT_LENGTH = 0.132f;
|
const float ScoringParams::DISTANCE_WEIGHT_LENGTH = 0.132f;
|
||||||
|
|
|
@ -29,6 +29,7 @@ class ScoringParams {
|
||||||
static const int THRESHOLD_NEXT_WORD_PROBABILITY_FOR_CAPPED;
|
static const int THRESHOLD_NEXT_WORD_PROBABILITY_FOR_CAPPED;
|
||||||
static const float AUTOCORRECT_OUTPUT_THRESHOLD;
|
static const float AUTOCORRECT_OUTPUT_THRESHOLD;
|
||||||
static const int MAX_CACHE_DIC_NODE_SIZE;
|
static const int MAX_CACHE_DIC_NODE_SIZE;
|
||||||
|
static const int MAX_CACHE_DIC_NODE_SIZE_FOR_SINGLE_POINT;
|
||||||
static const int THRESHOLD_SHORT_WORD_LENGTH;
|
static const int THRESHOLD_SHORT_WORD_LENGTH;
|
||||||
|
|
||||||
// Numerically optimized parameters (currently for tap typing only).
|
// Numerically optimized parameters (currently for tap typing only).
|
||||||
|
|
|
@ -151,8 +151,9 @@ class TypingTraversal : public Traversal {
|
||||||
dicNode->getOutputWordBuf(), dicNode->getNodeCodePointCount());
|
dicNode->getOutputWordBuf(), dicNode->getNodeCodePointCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
AK_FORCE_INLINE int getMaxCacheSize() const {
|
AK_FORCE_INLINE int getMaxCacheSize(const int inputSize) const {
|
||||||
return ScoringParams::MAX_CACHE_DIC_NODE_SIZE;
|
return (inputSize <= 1) ? ScoringParams::MAX_CACHE_DIC_NODE_SIZE_FOR_SINGLE_POINT
|
||||||
|
: ScoringParams::MAX_CACHE_DIC_NODE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
AK_FORCE_INLINE bool isPossibleOmissionChildNode(
|
AK_FORCE_INLINE bool isPossibleOmissionChildNode(
|
||||||
|
|
Loading…
Reference in a new issue