Home
last modified time | relevance | path

Searched refs:ptNodeParams (Results 1 – 20 of 20) sorted by relevance

/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/pt_common/
Ddynamic_pt_reading_helper.cpp30 const PtNodeParams *const ptNodeParams) { in onVisitingPtNode() argument
31 if (ptNodeParams->isTerminal() && !ptNodeParams->isDeleted()) { in onVisitingPtNode()
32 mTerminalPositions->push_back(ptNodeParams->getHeadPos()); in onVisitingPtNode()
49 const PtNodeParams ptNodeParams(getPtNodeParams()); in traverseAllPtNodesInPostorderDepthFirstManner() local
50 if (!ptNodeParams.isValid()) { in traverseAllPtNodesInPostorderDepthFirstManner()
54 if (ptNodeParams.hasChildren()) { in traverseAllPtNodesInPostorderDepthFirstManner()
56 if (!listener->onDescend(ptNodeParams.getChildrenPos())) { in traverseAllPtNodesInPostorderDepthFirstManner()
60 readChildNode(ptNodeParams); in traverseAllPtNodesInPostorderDepthFirstManner()
65 if (!listener->onVisitingPtNode(&ptNodeParams)) { in traverseAllPtNodesInPostorderDepthFirstManner()
68 readNextSiblingNode(ptNodeParams); in traverseAllPtNodesInPostorderDepthFirstManner()
[all …]
Ddynamic_pt_gc_event_listeners.cpp28 ::onVisitingPtNode(const PtNodeParams *const ptNodeParams) { in onVisitingPtNode() argument
31 bool isUselessPtNode = !ptNodeParams->isTerminal(); in onVisitingPtNode()
32 if (ptNodeParams->isTerminal() && !ptNodeParams->representsNonWordInfo()) { in onVisitingPtNode()
35 ptNodeParams, &needsToKeepPtNode)) { in onVisitingPtNode()
45 } else if (ptNodeParams->isTerminal()) { in onVisitingPtNode()
47 if (!mPtNodeWriter->updateChildrenPosition(ptNodeParams, in onVisitingPtNode()
54 if (!mPtNodeWriter->markPtNodeAsDeleted(ptNodeParams)) { in onVisitingPtNode()
59 if (ptNodeParams->isTerminal() && !ptNodeParams->representsNonWordInfo()) { in onVisitingPtNode()
67 ::onVisitingPtNode(const PtNodeParams *const ptNodeParams) { in onVisitingPtNode() argument
68 if (!ptNodeParams->isDeleted()) { in onVisitingPtNode()
[all …]
Dpt_node_params.h43 PtNodeParams(const PtNodeParams& ptNodeParams) in PtNodeParams() argument
44 : mHeadPos(ptNodeParams.mHeadPos), mFlags(ptNodeParams.mFlags), in PtNodeParams()
45 mHasMovedFlag(ptNodeParams.mHasMovedFlag), mParentPos(ptNodeParams.mParentPos), in PtNodeParams()
46 mCodePointCount(ptNodeParams.mCodePointCount), mCodePoints(), in PtNodeParams()
47 mTerminalIdFieldPos(ptNodeParams.mTerminalIdFieldPos), in PtNodeParams()
48 mTerminalId(ptNodeParams.mTerminalId), in PtNodeParams()
49 mProbabilityFieldPos(ptNodeParams.mProbabilityFieldPos), in PtNodeParams()
50 mProbability(ptNodeParams.mProbability), in PtNodeParams()
51 mChildrenPosFieldPos(ptNodeParams.mChildrenPosFieldPos), in PtNodeParams()
52 mChildrenPos(ptNodeParams.mChildrenPos), in PtNodeParams()
[all …]
Ddynamic_pt_reading_helper.h68 bool onVisitingPtNode(const PtNodeParams *const ptNodeParams);
131 AK_FORCE_INLINE bool isValidTerminalNode(const PtNodeParams &ptNodeParams) const { in isValidTerminalNode() argument
132 return !isEnd() && !ptNodeParams.isDeleted() && ptNodeParams.isTerminal(); in isValidTerminalNode()
135 AK_FORCE_INLINE bool isMatchedCodePoint(const PtNodeParams &ptNodeParams, const int index, in isMatchedCodePoint() argument
137 return ptNodeParams.getCodePoints()[index] == codePoint; in isMatchedCodePoint()
146 AK_FORCE_INLINE size_t getTotalCodePointCount(const PtNodeParams &ptNodeParams) const { in getTotalCodePointCount() argument
148 + ptNodeParams.getCodePointCount(); in getTotalCodePointCount()
151 AK_FORCE_INLINE void fetchMergedNodeCodePointsInReverseOrder(const PtNodeParams &ptNodeParams, in fetchMergedNodeCodePointsInReverseOrder() argument
153 const int nodeCodePointCount = ptNodeParams.getCodePointCount(); in fetchMergedNodeCodePointsInReverseOrder()
154 const int *const nodeCodePoints = ptNodeParams.getCodePoints(); in fetchMergedNodeCodePointsInReverseOrder()
[all …]
Ddynamic_pt_updating_helper.cpp36 const PtNodeParams ptNodeParams(readingHelper->getPtNodeParams()); in addUnigramWord() local
37 if (!ptNodeParams.isValid()) { in addUnigramWord()
41 if (!readingHelper->isMatchedCodePoint(ptNodeParams, 0 /* index */, in addUnigramWord()
45 readingHelper->readNextSiblingNode(ptNodeParams); in addUnigramWord()
49 const size_t nodeCodePointCount = ptNodeParams.getCodePointArrayView().size(); in addUnigramWord()
53 || !readingHelper->isMatchedCodePoint(ptNodeParams, j, in addUnigramWord()
56 return reallocatePtNodeAndAddNewPtNodes(&ptNodeParams, j, unigramProperty, in addUnigramWord()
61 if (wordCodePoints.size() == readingHelper->getTotalCodePointCount(ptNodeParams)) { in addUnigramWord()
62 return setPtNodeProbability(&ptNodeParams, unigramProperty, outAddedNewUnigram); in addUnigramWord()
64 if (!ptNodeParams.hasChildren()) { in addUnigramWord()
[all …]
Ddynamic_pt_gc_event_listeners.h63 bool onVisitingPtNode(const PtNodeParams *const ptNodeParams);
94 bool onVisitingPtNode(const PtNodeParams *const ptNodeParams);
123 bool onVisitingPtNode(const PtNodeParams *const ptNodeParams);
150 bool onVisitingPtNode(const PtNodeParams *const ptNodeParams);
Dpt_node_writer.h68 virtual bool writePtNodeAndAdvancePosition(const PtNodeParams *const ptNodeParams,
71 virtual bool writeNewTerminalPtNodeAndAdvancePosition(const PtNodeParams *const ptNodeParams,
86 virtual bool addShortcutTarget(const PtNodeParams *const ptNodeParams,
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/backward/v402/
Dver4_patricia_trie_node_writer.cpp212 const PtNodeParams *const ptNodeParams, int *const ptNodeWritingPos) { in writePtNodeAndAdvancePosition() argument
213 return writePtNodeAndGetTerminalIdAndAdvancePosition(ptNodeParams, 0 /* outTerminalId */, in writePtNodeAndAdvancePosition()
219 const PtNodeParams *const ptNodeParams, const UnigramProperty *const unigramProperty, in writeNewTerminalPtNodeAndAdvancePosition() argument
222 if (!writePtNodeAndGetTerminalIdAndAdvancePosition(ptNodeParams, &terminalId, in writeNewTerminalPtNodeAndAdvancePosition()
308 bool Ver4PatriciaTrieNodeWriter::addShortcutTarget(const PtNodeParams *const ptNodeParams, in addShortcutTarget() argument
311 if (!mShortcutPolicy->addNewShortcut(ptNodeParams->getTerminalId(), in addShortcutTarget()
313 AKLOGE("Cannot add new shortcut entry. terminalId: %d", ptNodeParams->getTerminalId()); in addShortcutTarget()
316 if (!ptNodeParams->hasShortcutTargets()) { in addShortcutTarget()
318 return updatePtNodeFlags(ptNodeParams->getHeadPos(), in addShortcutTarget()
319 ptNodeParams->isPossiblyOffensive(), ptNodeParams->isNotAWord(), in addShortcutTarget()
[all …]
Dver4_patricia_trie_policy.cpp65 const PtNodeParams ptNodeParams = readingHelper.getPtNodeParams(); in createAndGetAllChildDicNodes() local
66 if (!ptNodeParams.isValid()) { in createAndGetAllChildDicNodes()
69 bool isTerminal = ptNodeParams.isTerminal() && !ptNodeParams.isDeleted(); in createAndGetAllChildDicNodes()
74 isTerminal = ptNodeParams.getProbability() != NOT_A_PROBABILITY; in createAndGetAllChildDicNodes()
76 readingHelper.readNextSiblingNode(ptNodeParams); in createAndGetAllChildDicNodes()
77 if (ptNodeParams.representsNonWordInfo()) { in createAndGetAllChildDicNodes()
81 const int wordId = isTerminal ? ptNodeParams.getHeadPos() : NOT_A_WORD_ID; in createAndGetAllChildDicNodes()
82 childDicNodes->pushLeavingChild(dicNode, ptNodeParams.getChildrenPos(), in createAndGetAllChildDicNodes()
83 wordId, ptNodeParams.getCodePointArrayView()); in createAndGetAllChildDicNodes()
125 const PtNodeParams ptNodeParams(mNodeReader.fetchPtNodeParamsInBufferFromPtNodePos(ptNodePos)); in getWordAttributesInContext() local
[all …]
Dver4_patricia_trie_writing_helper.cpp229 const PtNodeParams ptNodeParams = in truncateUnigrams() local
231 if (ptNodeParams.representsNonWordInfo()) { in truncateUnigrams()
234 if (!ptNodeWriter->markPtNodeAsWillBecomeNonTerminal(&ptNodeParams)) { in truncateUnigrams()
288 ::onVisitingPtNode(const PtNodeParams *const ptNodeParams) { in onVisitingPtNode() argument
289 if (!ptNodeParams->isTerminal()) { in onVisitingPtNode()
293 mTerminalIdMap->find(ptNodeParams->getTerminalId()); in onVisitingPtNode()
296 ptNodeParams->getTerminalId(), mTerminalIdMap->size()); in onVisitingPtNode()
299 if (!mPtNodeWriter->updateTerminalId(ptNodeParams, it->second)) { in onVisitingPtNode()
302 return mPtNodeWriter->updatePtNodeHasBigramsAndShortcutTargetsFlags(ptNodeParams); in onVisitingPtNode()
Dver4_patricia_trie_node_writer.h90 virtual bool writePtNodeAndAdvancePosition(const PtNodeParams *const ptNodeParams,
93 virtual bool writeNewTerminalPtNodeAndAdvancePosition(const PtNodeParams *const ptNodeParams,
108 virtual bool addShortcutTarget(const PtNodeParams *const ptNodeParams,
112 bool updatePtNodeHasBigramsAndShortcutTargetsFlags(const PtNodeParams *const ptNodeParams);
117 bool suppressUnigramEntry(const PtNodeParams *const ptNodeParams);
123 const PtNodeParams *const ptNodeParams, int *const outTerminalId,
Dver4_patricia_trie_writing_helper.h73 bool onVisitingPtNode(const PtNodeParams *const ptNodeParams);
Dver4_patricia_trie_policy.h174 const PtNodeParams &ptNodeParams) const;
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v4/
Dver4_patricia_trie_node_writer.cpp185 const PtNodeParams *const ptNodeParams, int *const ptNodeWritingPos) { in writePtNodeAndAdvancePosition() argument
186 return writePtNodeAndGetTerminalIdAndAdvancePosition(ptNodeParams, 0 /* outTerminalId */, in writePtNodeAndAdvancePosition()
191 const PtNodeParams *const ptNodeParams, const UnigramProperty *const unigramProperty, in writeNewTerminalPtNodeAndAdvancePosition() argument
194 if (!writePtNodeAndGetTerminalIdAndAdvancePosition(ptNodeParams, &terminalId, in writeNewTerminalPtNodeAndAdvancePosition()
274 bool Ver4PatriciaTrieNodeWriter::addShortcutTarget(const PtNodeParams *const ptNodeParams, in addShortcutTarget() argument
277 if (!mShortcutPolicy->addNewShortcut(ptNodeParams->getTerminalId(), in addShortcutTarget()
279 AKLOGE("Cannot add new shortcut entry. terminalId: %d", ptNodeParams->getTerminalId()); in addShortcutTarget()
286 const PtNodeParams *const ptNodeParams, int *const outTerminalId, in writePtNodeAndGetTerminalIdAndAdvancePosition() argument
297 ptNodeParams->getParentPos(), nodePos, ptNodeWritingPos)) { in writePtNodeAndGetTerminalIdAndAdvancePosition()
302 ptNodeParams->getCodePoints(), ptNodeParams->getCodePointCount(), ptNodeWritingPos)) { in writePtNodeAndGetTerminalIdAndAdvancePosition()
[all …]
Dver4_patricia_trie_policy.cpp56 const PtNodeParams ptNodeParams = readingHelper.getPtNodeParams(); in createAndGetAllChildDicNodes() local
57 if (!ptNodeParams.isValid()) { in createAndGetAllChildDicNodes()
60 const bool isTerminal = ptNodeParams.isTerminal() && !ptNodeParams.isDeleted(); in createAndGetAllChildDicNodes()
61 const int wordId = isTerminal ? ptNodeParams.getTerminalId() : NOT_A_WORD_ID; in createAndGetAllChildDicNodes()
62 childDicNodes->pushLeavingChild(dicNode, ptNodeParams.getChildrenPos(), in createAndGetAllChildDicNodes()
63 wordId, ptNodeParams.getCodePointArrayView()); in createAndGetAllChildDicNodes()
64 readingHelper.readNextSiblingNode(ptNodeParams); in createAndGetAllChildDicNodes()
100 const PtNodeParams ptNodeParams = mNodeReader.fetchPtNodeParamsInBufferFromPtNodePos(ptNodePos); in getWordId() local
101 if (ptNodeParams.isDeleted()) { in getWordId()
104 return ptNodeParams.getTerminalId(); in getWordId()
[all …]
Dver4_patricia_trie_writing_helper.cpp167 ::onVisitingPtNode(const PtNodeParams *const ptNodeParams) { in onVisitingPtNode() argument
168 if (!ptNodeParams->isTerminal()) { in onVisitingPtNode()
172 mTerminalIdMap->find(ptNodeParams->getTerminalId()); in onVisitingPtNode()
175 ptNodeParams->getTerminalId(), mTerminalIdMap->size()); in onVisitingPtNode()
178 if (!mPtNodeWriter->updateTerminalId(ptNodeParams, it->second)) { in onVisitingPtNode()
Dver4_patricia_trie_node_writer.h69 virtual bool writePtNodeAndAdvancePosition(const PtNodeParams *const ptNodeParams,
72 virtual bool writeNewTerminalPtNodeAndAdvancePosition(const PtNodeParams *const ptNodeParams,
87 virtual bool addShortcutTarget(const PtNodeParams *const ptNodeParams,
95 const PtNodeParams *const ptNodeParams, int *const outTerminalId,
Dver4_patricia_trie_writing_helper.h60 bool onVisitingPtNode(const PtNodeParams *const ptNodeParams);
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v2/
Dpatricia_trie_policy.cpp300 const PtNodeParams ptNodeParams = in getWordAttributesInContext() local
304 prevWordIds, wordId, ptNodeParams.getProbability()); in getWordAttributesInContext()
305 return getWordAttributes(probability, ptNodeParams); in getWordAttributesInContext()
310 return getWordAttributes(bigramProbability, ptNodeParams); in getWordAttributesInContext()
313 return getWordAttributes(getProbability(ptNodeParams.getProbability(), NOT_A_PROBABILITY), in getWordAttributesInContext()
314 ptNodeParams); in getWordAttributesInContext()
318 const PtNodeParams &ptNodeParams) const { in getWordAttributes()
319 return WordAttributes(probability, false /* isBlacklisted */, ptNodeParams.isNotAWord(), in getWordAttributes()
320 ptNodeParams.isPossiblyOffensive()); in getWordAttributes()
345 const PtNodeParams ptNodeParams = in getProbabilityOfWord() local
[all …]
Dpatricia_trie_policy.h176 const PtNodeParams &ptNodeParams) const;