parent
dfecc86f25
commit
7fd9667d76
|
@ -1,58 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2013 The Android Open Source Project
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LATINIME_DIC_NODE_PROXIMITY_FILTER_H
|
|
||||||
#define LATINIME_DIC_NODE_PROXIMITY_FILTER_H
|
|
||||||
|
|
||||||
#include "defines.h"
|
|
||||||
#include "suggest/core/layout/proximity_info_state.h"
|
|
||||||
#include "suggest/core/layout/proximity_info_utils.h"
|
|
||||||
#include "suggest/core/policy/dictionary_structure_with_buffer_policy.h"
|
|
||||||
|
|
||||||
namespace latinime {
|
|
||||||
|
|
||||||
class DicNodeProximityFilter : public DictionaryStructureWithBufferPolicy::NodeFilter {
|
|
||||||
public:
|
|
||||||
DicNodeProximityFilter(const ProximityInfoState *const pInfoState,
|
|
||||||
const int pointIndex, const bool exactOnly)
|
|
||||||
: mProximityInfoState(pInfoState), mPointIndex(pointIndex), mExactOnly(exactOnly) {}
|
|
||||||
|
|
||||||
bool isFilteredOut(const int codePoint) const {
|
|
||||||
return !isProximityCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_IMPLICIT_CONSTRUCTORS(DicNodeProximityFilter);
|
|
||||||
|
|
||||||
const ProximityInfoState *const mProximityInfoState;
|
|
||||||
const int mPointIndex;
|
|
||||||
const bool mExactOnly;
|
|
||||||
|
|
||||||
// TODO: Move to proximity info state
|
|
||||||
bool isProximityCodePoint(const int codePoint) const {
|
|
||||||
if (!mProximityInfoState) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (mExactOnly) {
|
|
||||||
return mProximityInfoState->getPrimaryCodePointAt(mPointIndex) == codePoint;
|
|
||||||
}
|
|
||||||
const ProximityType matchedId = mProximityInfoState->getProximityType(
|
|
||||||
mPointIndex, codePoint, true /* checkProximityChars */);
|
|
||||||
return ProximityInfoUtils::isMatchOrProximityChar(matchedId);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} // namespace latinime
|
|
||||||
#endif // LATINIME_DIC_NODE_PROXIMITY_FILTER_H
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "suggest/core/dicnode/dic_node.h"
|
#include "suggest/core/dicnode/dic_node.h"
|
||||||
#include "suggest/core/dicnode/dic_node_proximity_filter.h"
|
|
||||||
#include "suggest/core/dicnode/dic_node_vector.h"
|
#include "suggest/core/dicnode/dic_node_vector.h"
|
||||||
#include "suggest/core/dictionary/multi_bigram_map.h"
|
#include "suggest/core/dictionary/multi_bigram_map.h"
|
||||||
#include "suggest/core/dictionary/probability_utils.h"
|
#include "suggest/core/dictionary/probability_utils.h"
|
||||||
|
@ -52,38 +51,16 @@ namespace latinime {
|
||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
// Traverse node expansion utils //
|
// Traverse node expansion utils //
|
||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
|
|
||||||
/* static */ void DicNodeUtils::createAndGetPassingChildNode(DicNode *dicNode,
|
|
||||||
const DicNodeProximityFilter *const childrenFilter,
|
|
||||||
DicNodeVector *childDicNodes) {
|
|
||||||
// Passing multiple chars node. No need to traverse child
|
|
||||||
const int codePoint = dicNode->getNodeTypedCodePoint();
|
|
||||||
const int baseLowerCaseCodePoint = CharUtils::toBaseLowerCase(codePoint);
|
|
||||||
if (!childrenFilter->isFilteredOut(codePoint)
|
|
||||||
|| CharUtils::isIntentionalOmissionCodePoint(baseLowerCaseCodePoint)) {
|
|
||||||
childDicNodes->pushPassingChild(dicNode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* static */ void DicNodeUtils::getAllChildDicNodes(DicNode *dicNode,
|
/* static */ void DicNodeUtils::getAllChildDicNodes(DicNode *dicNode,
|
||||||
const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
|
const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
|
||||||
DicNodeVector *childDicNodes) {
|
DicNodeVector *childDicNodes) {
|
||||||
getProximityChildDicNodes(dicNode, dictionaryStructurePolicy, 0, 0, false, childDicNodes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* static */ void DicNodeUtils::getProximityChildDicNodes(DicNode *dicNode,
|
|
||||||
const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
|
|
||||||
const ProximityInfoState *pInfoState, const int pointIndex, bool exactOnly,
|
|
||||||
DicNodeVector *childDicNodes) {
|
|
||||||
if (dicNode->isTotalInputSizeExceedingLimit()) {
|
if (dicNode->isTotalInputSizeExceedingLimit()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const DicNodeProximityFilter childrenFilter(pInfoState, pointIndex, exactOnly);
|
|
||||||
if (!dicNode->isLeavingNode()) {
|
if (!dicNode->isLeavingNode()) {
|
||||||
DicNodeUtils::createAndGetPassingChildNode(dicNode, &childrenFilter, childDicNodes);
|
childDicNodes->pushPassingChild(dicNode);
|
||||||
} else {
|
} else {
|
||||||
dictionaryStructurePolicy->createAndGetAllChildNodes(dicNode,
|
dictionaryStructurePolicy->createAndGetAllChildNodes(dicNode, childDicNodes);
|
||||||
&childrenFilter, childDicNodes);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,10 +24,8 @@
|
||||||
namespace latinime {
|
namespace latinime {
|
||||||
|
|
||||||
class DicNode;
|
class DicNode;
|
||||||
class DicNodeProximityFilter;
|
|
||||||
class DicNodeVector;
|
class DicNodeVector;
|
||||||
class DictionaryStructureWithBufferPolicy;
|
class DictionaryStructureWithBufferPolicy;
|
||||||
class ProximityInfoState;
|
|
||||||
class MultiBigramMap;
|
class MultiBigramMap;
|
||||||
|
|
||||||
class DicNodeUtils {
|
class DicNodeUtils {
|
||||||
|
@ -47,11 +45,6 @@ class DicNodeUtils {
|
||||||
static float getBigramNodeImprobability(
|
static float getBigramNodeImprobability(
|
||||||
const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
|
const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
|
||||||
const DicNode *const node, MultiBigramMap *const multiBigramMap);
|
const DicNode *const node, MultiBigramMap *const multiBigramMap);
|
||||||
// TODO: Move to private
|
|
||||||
static void getProximityChildDicNodes(DicNode *dicNode,
|
|
||||||
const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
|
|
||||||
const ProximityInfoState *pInfoState, const int pointIndex, bool exactOnly,
|
|
||||||
DicNodeVector *childDicNodes);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_IMPLICIT_CONSTRUCTORS(DicNodeUtils);
|
DISALLOW_IMPLICIT_CONSTRUCTORS(DicNodeUtils);
|
||||||
|
@ -61,8 +54,6 @@ class DicNodeUtils {
|
||||||
static int getBigramNodeProbability(
|
static int getBigramNodeProbability(
|
||||||
const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
|
const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
|
||||||
const DicNode *const node, MultiBigramMap *multiBigramMap);
|
const DicNode *const node, MultiBigramMap *multiBigramMap);
|
||||||
static void createAndGetPassingChildNode(DicNode *dicNode,
|
|
||||||
const DicNodeProximityFilter *const childrenFilter, DicNodeVector *childDicNodes);
|
|
||||||
};
|
};
|
||||||
} // namespace latinime
|
} // namespace latinime
|
||||||
#endif // LATINIME_DIC_NODE_UTILS_H
|
#endif // LATINIME_DIC_NODE_UTILS_H
|
||||||
|
|
|
@ -33,25 +33,12 @@ class DictionaryShortcutsStructurePolicy;
|
||||||
*/
|
*/
|
||||||
class DictionaryStructureWithBufferPolicy {
|
class DictionaryStructureWithBufferPolicy {
|
||||||
public:
|
public:
|
||||||
// This provides a filtering method for filtering new node.
|
|
||||||
class NodeFilter {
|
|
||||||
public:
|
|
||||||
virtual bool isFilteredOut(const int codePoint) const = 0;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
NodeFilter() {}
|
|
||||||
virtual ~NodeFilter() {}
|
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(NodeFilter);
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual ~DictionaryStructureWithBufferPolicy() {}
|
virtual ~DictionaryStructureWithBufferPolicy() {}
|
||||||
|
|
||||||
virtual int getRootPosition() const = 0;
|
virtual int getRootPosition() const = 0;
|
||||||
|
|
||||||
virtual void createAndGetAllChildNodes(const DicNode *const dicNode,
|
virtual void createAndGetAllChildNodes(const DicNode *const dicNode,
|
||||||
const NodeFilter *const nodeFilter, DicNodeVector *const childDicNodes) const = 0;
|
DicNodeVector *const childDicNodes) const = 0;
|
||||||
|
|
||||||
virtual int getCodePointsAndProbabilityAndReturnCodePointCount(
|
virtual int getCodePointsAndProbabilityAndReturnCodePointCount(
|
||||||
const int nodePos, const int maxCodePointCount, int *const outCodePoints,
|
const int nodePos, const int maxCodePointCount, int *const outCodePoints,
|
||||||
|
|
|
@ -456,7 +456,6 @@ void Suggest::processDicNodeAsOmission(
|
||||||
Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_OMISSION, traverseSession,
|
Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_OMISSION, traverseSession,
|
||||||
dicNode, childDicNode, 0 /* multiBigramMap */);
|
dicNode, childDicNode, 0 /* multiBigramMap */);
|
||||||
weightChildNode(traverseSession, childDicNode);
|
weightChildNode(traverseSession, childDicNode);
|
||||||
|
|
||||||
if (!TRAVERSAL->isPossibleOmissionChildNode(traverseSession, dicNode, childDicNode)) {
|
if (!TRAVERSAL->isPossibleOmissionChildNode(traverseSession, dicNode, childDicNode)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -472,11 +471,14 @@ void Suggest::processDicNodeAsInsertion(DicTraverseSession *traverseSession,
|
||||||
DicNode *dicNode) const {
|
DicNode *dicNode) const {
|
||||||
const int16_t pointIndex = dicNode->getInputIndex(0);
|
const int16_t pointIndex = dicNode->getInputIndex(0);
|
||||||
DicNodeVector childDicNodes;
|
DicNodeVector childDicNodes;
|
||||||
DicNodeUtils::getProximityChildDicNodes(dicNode,
|
DicNodeUtils::getAllChildDicNodes(dicNode, traverseSession->getDictionaryStructurePolicy(),
|
||||||
traverseSession->getDictionaryStructurePolicy(),
|
&childDicNodes);
|
||||||
traverseSession->getProximityInfoState(0), pointIndex + 1, true, &childDicNodes);
|
|
||||||
const int size = childDicNodes.getSizeAndLock();
|
const int size = childDicNodes.getSizeAndLock();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
|
if (traverseSession->getProximityInfoState(0)->getPrimaryCodePointAt(pointIndex + 1)
|
||||||
|
!= childDicNodes[i]->getNodeCodePoint()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
DicNode *const childDicNode = childDicNodes[i];
|
DicNode *const childDicNode = childDicNodes[i];
|
||||||
Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_INSERTION, traverseSession,
|
Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_INSERTION, traverseSession,
|
||||||
dicNode, childDicNode, 0 /* multiBigramMap */);
|
dicNode, childDicNode, 0 /* multiBigramMap */);
|
||||||
|
@ -491,19 +493,29 @@ void Suggest::processDicNodeAsTransposition(DicTraverseSession *traverseSession,
|
||||||
DicNode *dicNode) const {
|
DicNode *dicNode) const {
|
||||||
const int16_t pointIndex = dicNode->getInputIndex(0);
|
const int16_t pointIndex = dicNode->getInputIndex(0);
|
||||||
DicNodeVector childDicNodes1;
|
DicNodeVector childDicNodes1;
|
||||||
DicNodeUtils::getProximityChildDicNodes(dicNode,
|
DicNodeUtils::getAllChildDicNodes(dicNode, traverseSession->getDictionaryStructurePolicy(),
|
||||||
traverseSession->getDictionaryStructurePolicy(),
|
&childDicNodes1);
|
||||||
traverseSession->getProximityInfoState(0), pointIndex + 1, false, &childDicNodes1);
|
|
||||||
const int childSize1 = childDicNodes1.getSizeAndLock();
|
const int childSize1 = childDicNodes1.getSizeAndLock();
|
||||||
for (int i = 0; i < childSize1; i++) {
|
for (int i = 0; i < childSize1; i++) {
|
||||||
|
const ProximityType matchedId1 = traverseSession->getProximityInfoState(0)
|
||||||
|
->getProximityType(pointIndex + 1, childDicNodes1[i]->getNodeCodePoint(),
|
||||||
|
true /* checkProximityChars */);
|
||||||
|
if (!ProximityInfoUtils::isMatchOrProximityChar(matchedId1)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (childDicNodes1[i]->hasChildren()) {
|
if (childDicNodes1[i]->hasChildren()) {
|
||||||
DicNodeVector childDicNodes2;
|
DicNodeVector childDicNodes2;
|
||||||
DicNodeUtils::getProximityChildDicNodes(
|
DicNodeUtils::getAllChildDicNodes(childDicNodes1[i],
|
||||||
childDicNodes1[i], traverseSession->getDictionaryStructurePolicy(),
|
traverseSession->getDictionaryStructurePolicy(), &childDicNodes2);
|
||||||
traverseSession->getProximityInfoState(0), pointIndex, false, &childDicNodes2);
|
|
||||||
const int childSize2 = childDicNodes2.getSizeAndLock();
|
const int childSize2 = childDicNodes2.getSizeAndLock();
|
||||||
for (int j = 0; j < childSize2; j++) {
|
for (int j = 0; j < childSize2; j++) {
|
||||||
DicNode *const childDicNode2 = childDicNodes2[j];
|
DicNode *const childDicNode2 = childDicNodes2[j];
|
||||||
|
const ProximityType matchedId2 = traverseSession->getProximityInfoState(0)
|
||||||
|
->getProximityType(pointIndex, childDicNode2->getNodeCodePoint(),
|
||||||
|
true /* checkProximityChars */);
|
||||||
|
if (!ProximityInfoUtils::isMatchOrProximityChar(matchedId2)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_TRANSPOSITION,
|
Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_TRANSPOSITION,
|
||||||
traverseSession, childDicNodes1[i], childDicNode2, 0 /* multiBigramMap */);
|
traverseSession, childDicNodes1[i], childDicNode2, 0 /* multiBigramMap */);
|
||||||
processExpandedDicNode(traverseSession, childDicNode2);
|
processExpandedDicNode(traverseSession, childDicNode2);
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace latinime {
|
||||||
const int DynamicPatriciaTriePolicy::MAX_CHILD_COUNT_TO_AVOID_INFINITE_LOOP = 100000;
|
const int DynamicPatriciaTriePolicy::MAX_CHILD_COUNT_TO_AVOID_INFINITE_LOOP = 100000;
|
||||||
|
|
||||||
void DynamicPatriciaTriePolicy::createAndGetAllChildNodes(const DicNode *const dicNode,
|
void DynamicPatriciaTriePolicy::createAndGetAllChildNodes(const DicNode *const dicNode,
|
||||||
const NodeFilter *const nodeFilter, DicNodeVector *const childDicNodes) const {
|
DicNodeVector *const childDicNodes) const {
|
||||||
if (!dicNode->hasChildren()) {
|
if (!dicNode->hasChildren()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -52,8 +52,8 @@ void DynamicPatriciaTriePolicy::createAndGetAllChildNodes(const DicNode *const d
|
||||||
for (int i = 0; i < childCount; i++) {
|
for (int i = 0; i < childCount; i++) {
|
||||||
nodeReader.fetchNodeInfoFromBufferAndGetNodeCodePoints(nextPos, MAX_WORD_LENGTH,
|
nodeReader.fetchNodeInfoFromBufferAndGetNodeCodePoints(nextPos, MAX_WORD_LENGTH,
|
||||||
mergedNodeCodePoints);
|
mergedNodeCodePoints);
|
||||||
if (!nodeReader.isDeleted() && !nodeFilter->isFilteredOut(mergedNodeCodePoints[0])) {
|
if (!nodeReader.isDeleted()) {
|
||||||
// Push child node when the node is not deleted and not filtered out.
|
// Push child node when the node is not a deleted node.
|
||||||
childDicNodes->pushLeavingChild(dicNode, nodeReader.getNodePos(),
|
childDicNodes->pushLeavingChild(dicNode, nodeReader.getNodePos(),
|
||||||
nodeReader.getChildrenPos(), nodeReader.getProbability(),
|
nodeReader.getChildrenPos(), nodeReader.getProbability(),
|
||||||
nodeReader.isTerminal(), nodeReader.hasChildren(),
|
nodeReader.isTerminal(), nodeReader.hasChildren(),
|
||||||
|
|
|
@ -43,7 +43,7 @@ class DynamicPatriciaTriePolicy : public DictionaryStructureWithBufferPolicy {
|
||||||
}
|
}
|
||||||
|
|
||||||
void createAndGetAllChildNodes(const DicNode *const dicNode,
|
void createAndGetAllChildNodes(const DicNode *const dicNode,
|
||||||
const NodeFilter *const nodeFilter, DicNodeVector *const childDicNodes) const;
|
DicNodeVector *const childDicNodes) const;
|
||||||
|
|
||||||
int getCodePointsAndProbabilityAndReturnCodePointCount(
|
int getCodePointsAndProbabilityAndReturnCodePointCount(
|
||||||
const int terminalNodePos, const int maxCodePointCount, int *const outCodePoints,
|
const int terminalNodePos, const int maxCodePointCount, int *const outCodePoints,
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
namespace latinime {
|
namespace latinime {
|
||||||
|
|
||||||
void PatriciaTriePolicy::createAndGetAllChildNodes(const DicNode *const dicNode,
|
void PatriciaTriePolicy::createAndGetAllChildNodes(const DicNode *const dicNode,
|
||||||
const NodeFilter *const nodeFilter, DicNodeVector *const childDicNodes) const {
|
DicNodeVector *const childDicNodes) const {
|
||||||
if (!dicNode->hasChildren()) {
|
if (!dicNode->hasChildren()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ void PatriciaTriePolicy::createAndGetAllChildNodes(const DicNode *const dicNode,
|
||||||
const int childCount = PatriciaTrieReadingUtils::getGroupCountAndAdvancePosition(
|
const int childCount = PatriciaTrieReadingUtils::getGroupCountAndAdvancePosition(
|
||||||
mDictRoot, &nextPos);
|
mDictRoot, &nextPos);
|
||||||
for (int i = 0; i < childCount; i++) {
|
for (int i = 0; i < childCount; i++) {
|
||||||
nextPos = createAndGetLeavingChildNode(dicNode, nextPos, nodeFilter, childDicNodes);
|
nextPos = createAndGetLeavingChildNode(dicNode, nextPos, childDicNodes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,8 +116,7 @@ int PatriciaTriePolicy::getBigramsPositionOfNode(const int nodePos) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
int PatriciaTriePolicy::createAndGetLeavingChildNode(const DicNode *const dicNode,
|
int PatriciaTriePolicy::createAndGetLeavingChildNode(const DicNode *const dicNode,
|
||||||
const int nodePos, const NodeFilter *const childrenFilter,
|
const int nodePos, DicNodeVector *childDicNodes) const {
|
||||||
DicNodeVector *childDicNodes) const {
|
|
||||||
int pos = nodePos;
|
int pos = nodePos;
|
||||||
const PatriciaTrieReadingUtils::NodeFlags flags =
|
const PatriciaTrieReadingUtils::NodeFlags flags =
|
||||||
PatriciaTrieReadingUtils::getFlagsAndAdvancePosition(mDictRoot, &pos);
|
PatriciaTrieReadingUtils::getFlagsAndAdvancePosition(mDictRoot, &pos);
|
||||||
|
@ -136,14 +135,12 @@ int PatriciaTriePolicy::createAndGetLeavingChildNode(const DicNode *const dicNod
|
||||||
if (PatriciaTrieReadingUtils::hasBigrams(flags)) {
|
if (PatriciaTrieReadingUtils::hasBigrams(flags)) {
|
||||||
getBigramsStructurePolicy()->skipAllBigrams(&pos);
|
getBigramsStructurePolicy()->skipAllBigrams(&pos);
|
||||||
}
|
}
|
||||||
if (!childrenFilter->isFilteredOut(mergedNodeCodePoints[0])) {
|
|
||||||
childDicNodes->pushLeavingChild(dicNode, nodePos, childrenPos, probability,
|
childDicNodes->pushLeavingChild(dicNode, nodePos, childrenPos, probability,
|
||||||
PatriciaTrieReadingUtils::isTerminal(flags),
|
PatriciaTrieReadingUtils::isTerminal(flags),
|
||||||
PatriciaTrieReadingUtils::hasChildrenInFlags(flags),
|
PatriciaTrieReadingUtils::hasChildrenInFlags(flags),
|
||||||
PatriciaTrieReadingUtils::isBlacklisted(flags) ||
|
PatriciaTrieReadingUtils::isBlacklisted(flags) ||
|
||||||
PatriciaTrieReadingUtils::isNotAWord(flags),
|
PatriciaTrieReadingUtils::isNotAWord(flags),
|
||||||
mergedNodeCodePointCount, mergedNodeCodePoints);
|
mergedNodeCodePointCount, mergedNodeCodePoints);
|
||||||
}
|
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ class PatriciaTriePolicy : public DictionaryStructureWithBufferPolicy {
|
||||||
}
|
}
|
||||||
|
|
||||||
void createAndGetAllChildNodes(const DicNode *const dicNode,
|
void createAndGetAllChildNodes(const DicNode *const dicNode,
|
||||||
const NodeFilter *const nodeFilter, DicNodeVector *const childDicNodes) const;
|
DicNodeVector *const childDicNodes) const;
|
||||||
|
|
||||||
int getCodePointsAndProbabilityAndReturnCodePointCount(
|
int getCodePointsAndProbabilityAndReturnCodePointCount(
|
||||||
const int terminalNodePos, const int maxCodePointCount, int *const outCodePoints,
|
const int terminalNodePos, const int maxCodePointCount, int *const outCodePoints,
|
||||||
|
@ -79,7 +79,7 @@ class PatriciaTriePolicy : public DictionaryStructureWithBufferPolicy {
|
||||||
const ShortcutListPolicy mShortcutListPolicy;
|
const ShortcutListPolicy mShortcutListPolicy;
|
||||||
|
|
||||||
int createAndGetLeavingChildNode(const DicNode *const dicNode, const int nodePos,
|
int createAndGetLeavingChildNode(const DicNode *const dicNode, const int nodePos,
|
||||||
const NodeFilter *const nodeFilter, DicNodeVector *const childDicNodes) const;
|
DicNodeVector *const childDicNodes) const;
|
||||||
};
|
};
|
||||||
} // namespace latinime
|
} // namespace latinime
|
||||||
#endif // LATINIME_PATRICIA_TRIE_POLICY_H
|
#endif // LATINIME_PATRICIA_TRIE_POLICY_H
|
||||||
|
|
Loading…
Reference in New Issue