Increase terminal cache size for gesture.

Before:
(0)  670.00 (10.52%)
(1)  5530.00 (86.81%)
(2)  120.00 (1.88%)
Total 6370.00 (sum of others 6320.00)

After:
(0)  730.00 (11.06%)
(1)  5750.00 (87.12%)
(2)  100.00 (1.52%)
Total 6600.00 (sum of others 6580.00)

Bug: 13773693
Bug: 10701902
Bug: 9505397
Change-Id: Ie53640994180a7acabe05da544ab2166403e2394
main
Keisuke Kuroyanagi 2014-04-08 22:56:58 +09:00
parent bc9500fb14
commit 63d33f42c8
3 changed files with 6 additions and 1 deletions

View File

@ -45,6 +45,7 @@ class Traversal {
virtual float getMaxSpatialDistance() const = 0;
virtual int getDefaultExpandDicNodeSize() const = 0;
virtual int getMaxCacheSize(const int inputSize) const = 0;
virtual int getTerminalCacheSize() const = 0;
virtual bool isPossibleOmissionChildNode(const DicTraverseSession *const traverseSession,
const DicNode *const parentDicNode, const DicNode *const dicNode) const = 0;
virtual bool isGoodToTraverseNextWord(const DicNode *const dicNode) const = 0;

View File

@ -88,7 +88,7 @@ void Suggest::initializeSearch(DicTraverseSession *traverseSession) const {
} else {
// Restart recognition at the root.
traverseSession->resetCache(TRAVERSAL->getMaxCacheSize(traverseSession->getInputSize()),
MAX_RESULTS);
TRAVERSAL->getTerminalCacheSize());
// Create a new dic node here
DicNode rootNode;
DicNodeUtils::initAsRoot(traverseSession->getDictionaryStructurePolicy(),

View File

@ -146,6 +146,10 @@ class TypingTraversal : public Traversal {
: ScoringParams::MAX_CACHE_DIC_NODE_SIZE;
}
AK_FORCE_INLINE int getTerminalCacheSize() const {
return MAX_RESULTS;
}
AK_FORCE_INLINE bool isPossibleOmissionChildNode(
const DicTraverseSession *const traverseSession, const DicNode *const parentDicNode,
const DicNode *const dicNode) const {