/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/pt_common/ |
D | dynamic_pt_reading_helper.cpp | 30 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 …]
|
D | dynamic_pt_gc_event_listeners.cpp | 28 ::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 …]
|
D | pt_node_params.h | 43 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 …]
|
D | dynamic_pt_reading_helper.h | 68 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 …]
|
D | dynamic_pt_updating_helper.cpp | 36 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 …]
|
D | dynamic_pt_gc_event_listeners.h | 63 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);
|
D | pt_node_writer.h | 68 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/ |
D | ver4_patricia_trie_node_writer.cpp | 212 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 …]
|
D | ver4_patricia_trie_policy.cpp | 65 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 …]
|
D | ver4_patricia_trie_writing_helper.cpp | 229 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()
|
D | ver4_patricia_trie_node_writer.h | 90 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,
|
D | ver4_patricia_trie_writing_helper.h | 73 bool onVisitingPtNode(const PtNodeParams *const ptNodeParams);
|
D | ver4_patricia_trie_policy.h | 174 const PtNodeParams &ptNodeParams) const;
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v4/ |
D | ver4_patricia_trie_node_writer.cpp | 185 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 …]
|
D | ver4_patricia_trie_policy.cpp | 56 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 …]
|
D | ver4_patricia_trie_writing_helper.cpp | 167 ::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()
|
D | ver4_patricia_trie_node_writer.h | 69 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,
|
D | ver4_patricia_trie_writing_helper.h | 60 bool onVisitingPtNode(const PtNodeParams *const ptNodeParams);
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v2/ |
D | patricia_trie_policy.cpp | 300 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 …]
|
D | patricia_trie_policy.h | 176 const PtNodeParams &ptNodeParams) const;
|