Merge ""much" in suggestions of "m" after "very""

main
Keisuke Kuroynagi 2013-07-26 09:44:43 +00:00 committed by Android (Google) Code Review
commit 6613740e11
6 changed files with 10 additions and 5 deletions

View File

@ -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 {

View File

@ -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;

View File

@ -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(),

View File

@ -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;

View File

@ -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).

View File

@ -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(