Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4447b14b authored by Keisuke Kuroynagi's avatar Keisuke Kuroynagi
Browse files

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

Make cache size larger for single point input.

Bug: 9823678
Change-Id: Ic6bbcebd18eccaf9f9ac07d9c0d456a62f6c5287
parent ffcbbaf1
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -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 {


+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
+2 −1
Original line number Original line Diff line number Diff line
@@ -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(),
+1 −0
Original line number Original line Diff line number Diff line
@@ -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;
+1 −0
Original line number Original line Diff line number Diff line
@@ -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).
Loading