/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v4/content/ |
D | language_model_dict_content.cpp | 42 const WordAttributes LanguageModelDictContent::getWordAttributes(const WordIdArrayView prevWordIds, in getWordAttributes() argument 48 for (size_t i = 0; i < prevWordIds.size(); ++i) { in getWordAttributes() 50 mTrieMap.get(prevWordIds[i], bitmapEntryIndices[i]).mNextLevelBitmapEntryIndex; in getWordAttributes() 64 if (mustMatchAllPrevWords && prevWordIds.size() > static_cast<size_t>(i)) { in getWordAttributes() 82 prevWordIds.skip(1 /* n */).limit(i - 1), prevWordIds[0]); in getWordAttributes() 118 const WordIdArrayView prevWordIds, const int wordId) const { in getNgramProbabilityEntry() argument 119 const int bitmapEntryIndex = getBitmapEntryIndex(prevWordIds); in getNgramProbabilityEntry() 131 bool LanguageModelDictContent::setNgramProbabilityEntry(const WordIdArrayView prevWordIds, in setNgramProbabilityEntry() argument 136 const int bitmapEntryIndex = createAndGetBitmapEntryIndex(prevWordIds); in setNgramProbabilityEntry() 143 bool LanguageModelDictContent::removeNgramProbabilityEntry(const WordIdArrayView prevWordIds, in removeNgramProbabilityEntry() argument [all …]
|
D | language_model_dict_content.h | 116 DumppedFullEntryInfo(std::vector<int> &prevWordIds, const int targetWordId, in DumppedFullEntryInfo() argument 118 : mPrevWordIds(prevWordIds), mTargetWordId(targetWordId), in DumppedFullEntryInfo() 153 const WordAttributes getWordAttributes(const WordIdArrayView prevWordIds, const int wordId, 169 ProbabilityEntry getNgramProbabilityEntry(const WordIdArrayView prevWordIds, 172 bool setNgramProbabilityEntry(const WordIdArrayView prevWordIds, const int wordId, 175 bool removeNgramProbabilityEntry(const WordIdArrayView prevWordIds, const int wordId); 177 EntryRange getProbabilityEntries(const WordIdArrayView prevWordIds) const; 199 bool updateAllEntriesOnInputWord(const WordIdArrayView prevWordIds, const int wordId, 218 const int prevWordCount, const int *const prevWordIds); 240 int createAndGetBitmapEntryIndex(const WordIdArrayView prevWordIds); [all …]
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/utils/ |
D | multi_bigram_map.cpp | 38 const WordIdArrayView prevWordIds, const int nextWordId, in getBigramProbability() argument 40 if (prevWordIds.empty() || prevWordIds[0] == NOT_A_WORD_ID) { in getBigramProbability() 43 const auto mapPosition = mBigramMaps.find(prevWordIds[0]); in getBigramProbability() 49 addBigramsForWord(structurePolicy, prevWordIds); in getBigramProbability() 50 return mBigramMaps[prevWordIds[0]].getBigramProbability(structurePolicy, in getBigramProbability() 53 return readBigramProbabilityFromBinaryDictionary(structurePolicy, prevWordIds, in getBigramProbability() 59 const WordIdArrayView prevWordIds) { in init() argument 60 structurePolicy->iterateNgramEntries(prevWordIds, this /* listener */); in init() 86 const WordIdArrayView prevWordIds) { in addBigramsForWord() argument 87 mBigramMaps[prevWordIds[0]].init(structurePolicy, prevWordIds); in addBigramsForWord() [all …]
|
D | multi_bigram_map.h | 43 const WordIdArrayView prevWordIds, const int nextWordId, const int unigramProbability); 61 const WordIdArrayView prevWordIds); 74 const WordIdArrayView prevWordIds); 78 const WordIdArrayView prevWordIds, const int nextWordId, const int unigramProbability);
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v4/ |
D | ver4_patricia_trie_policy.cpp | 108 const WordIdArrayView prevWordIds, const int wordId, in getWordAttributesInContext() argument 113 return mBuffers->getLanguageModelDictContent()->getWordAttributes(prevWordIds, wordId, in getWordAttributesInContext() 117 int Ver4PatriciaTriePolicy::getProbabilityOfWord(const WordIdArrayView prevWordIds, in getProbabilityOfWord() argument 119 if (wordId == NOT_A_WORD_ID || prevWordIds.contains(NOT_A_WORD_ID)) { in getProbabilityOfWord() 123 mBuffers->getLanguageModelDictContent()->getWordAttributes(prevWordIds, wordId, in getProbabilityOfWord() 137 void Ver4PatriciaTriePolicy::iterateNgramEntries(const WordIdArrayView prevWordIds, in iterateNgramEntries() argument 139 if (prevWordIds.empty()) { in iterateNgramEntries() 143 for (size_t i = 1; i <= prevWordIds.size(); ++i) { in iterateNgramEntries() 145 prevWordIds.limit(i))) { in iterateNgramEntries() 293 const WordIdArrayView prevWordIds = ngramContext->getPrevWordIds(this, &prevWordIdArray, in addNgramEntry() local [all …]
|
D | ver4_patricia_trie_node_writer.cpp | 206 bool Ver4PatriciaTrieNodeWriter::addNgramEntry(const WordIdArrayView prevWordIds, const int wordId, in addNgramEntry() argument 211 languageModelDictContent->getNgramProbabilityEntry(prevWordIds, wordId); in addNgramEntry() 214 prevWordIds, wordId, &probabilityEntryOfNgramProperty)) { in addNgramEntry() 216 prevWordIds[0], prevWordIds.size(), wordId); in addNgramEntry() 225 bool Ver4PatriciaTrieNodeWriter::removeNgramEntry(const WordIdArrayView prevWordIds, in removeNgramEntry() argument 229 return languageModelDictContent->removeNgramProbabilityEntry(prevWordIds, wordId); in removeNgramEntry()
|
D | ver4_patricia_trie_policy.h | 69 const WordAttributes getWordAttributesInContext(const WordIdArrayView prevWordIds, 78 int getProbabilityOfWord(const WordIdArrayView prevWordIds, const int wordId) const; 80 void iterateNgramEntries(const WordIdArrayView prevWordIds,
|
D | ver4_patricia_trie_node_writer.h | 75 virtual bool addNgramEntry(const WordIdArrayView prevWordIds, const int wordId, 78 virtual bool removeNgramEntry(const WordIdArrayView prevWordIds, const int wordId);
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/backward/v402/ |
D | ver4_patricia_trie_policy.cpp | 119 const WordIdArrayView prevWordIds, const int wordId, in getWordAttributesInContext() argument 128 prevWordIds, wordId, ptNodeParams.getProbability()); in getWordAttributesInContext() 131 if (!prevWordIds.empty()) { in getWordAttributesInContext() 132 const int probability = getProbabilityOfWord(prevWordIds, wordId); in getWordAttributesInContext() 160 int Ver4PatriciaTriePolicy::getProbabilityOfWord(const WordIdArrayView prevWordIds, in getProbabilityOfWord() argument 170 if (prevWordIds.empty()) { in getProbabilityOfWord() 173 if (prevWordIds[0] == NOT_A_WORD_ID) { in getProbabilityOfWord() 177 mNodeReader.fetchPtNodeParamsInBufferFromPtNodePos(prevWordIds[0]); in getProbabilityOfWord() 198 void Ver4PatriciaTriePolicy::iterateNgramEntries(const WordIdArrayView prevWordIds, in iterateNgramEntries() argument 200 if (prevWordIds.firstOrDefault(NOT_A_DICT_POS) == NOT_A_DICT_POS) { in iterateNgramEntries() [all …]
|
D | ver4_patricia_trie_node_writer.cpp | 234 bool Ver4PatriciaTrieNodeWriter::addNgramEntry(const WordIdArrayView prevWordIds, const int wordId, in addNgramEntry() argument 236 if (!mBigramPolicy->addNewEntry(prevWordIds[0], wordId, ngramProperty, outAddedNewEntry)) { in addNgramEntry() 238 prevWordIds[0], wordId); in addNgramEntry() 242 mBuffers->getTerminalPositionLookupTable()->getTerminalPtNodePosition(prevWordIds[0]); in addNgramEntry() 256 bool Ver4PatriciaTrieNodeWriter::removeNgramEntry(const WordIdArrayView prevWordIds, in removeNgramEntry() argument 258 return mBigramPolicy->removeEntry(prevWordIds[0], wordId); in removeNgramEntry()
|
D | ver4_patricia_trie_policy.h | 94 const WordAttributes getWordAttributesInContext(const WordIdArrayView prevWordIds, 99 int getProbabilityOfWord(const WordIdArrayView prevWordIds, const int wordId) const; 101 void iterateNgramEntries(const WordIdArrayView prevWordIds,
|
D | ver4_patricia_trie_node_writer.h | 96 virtual bool addNgramEntry(const WordIdArrayView prevWordIds, const int wordId, 99 virtual bool removeNgramEntry(const WordIdArrayView prevWordIds, const int wordId);
|
/packages/inputmethods/LatinIME/native/jni/tests/dictionary/structure/v4/content/ |
D | language_model_dict_content_test.cpp | 100 const WordIdArrayView prevWordIds = WordIdArrayView::fromArray(prevWordIdArray); in TEST() local 105 languageModelDictContent.setProbabilityEntry(prevWordIds[0], &probabilityEntry); in TEST() 106 languageModelDictContent.setNgramProbabilityEntry(prevWordIds.limit(1), wordId, in TEST() 108 EXPECT_EQ(bigramProbability, languageModelDictContent.getWordAttributes(prevWordIds, wordId, in TEST() 111 languageModelDictContent.setNgramProbabilityEntry(prevWordIds.limit(1), in TEST() 112 prevWordIds[1], &probabilityEntry); in TEST() 113 languageModelDictContent.setNgramProbabilityEntry(prevWordIds.limit(2), wordId, in TEST() 115 EXPECT_EQ(trigramProbability, languageModelDictContent.getWordAttributes(prevWordIds, wordId, in TEST()
|
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/dicnode/internal/ |
D | dic_node_properties.h | 41 const uint16_t depth, const uint16_t leavingDepth, const WordIdArrayView prevWordIds) { in init() argument 47 prevWordIds.copyToArray(&mPrevWordIds, 0 /* offset */); in init() 48 mPrevWordCount = prevWordIds.size(); in init() 52 void init(const int rootPtNodeArrayPos, const WordIdArrayView prevWordIds) { in init() argument 58 prevWordIds.copyToArray(&mPrevWordIds, 0 /* offset */); in init() 59 mPrevWordCount = prevWordIds.size(); in init()
|
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/dictionary/ |
D | dictionary.cpp | 61 const NgramContext *const ngramContext, const WordIdArrayView prevWordIds, in NgramListenerForPrediction() argument 64 : mNgramContext(ngramContext), mPrevWordIds(prevWordIds), in NgramListenerForPrediction() 95 const WordIdArrayView prevWordIds = ngramContext->getPrevWordIds( in getPredictions() local 98 NgramListenerForPrediction listener(ngramContext, prevWordIds, outSuggestionResults, in getPredictions() 100 mDictionaryStructureWithBufferPolicy->iterateNgramEntries(prevWordIds, &listener); in getPredictions() 123 const WordIdArrayView prevWordIds = ngramContext->getPrevWordIds( in getNgramProbability() local 126 return getDictionaryStructurePolicy()->getProbabilityOfWord(prevWordIds, wordId); in getNgramProbability()
|
D | dictionary_utils.cpp | 39 const WordIdArrayView prevWordIds = emptyNgramContext.getPrevWordIds( in getMaxProbabilityOfExactMatches() local 42 DicNodeUtils::initAsRoot(dictionaryStructurePolicy, prevWordIds, ¤t.front()); in getMaxProbabilityOfExactMatches()
|
D | dictionary.h | 127 const WordIdArrayView prevWordIds, SuggestionResults *const suggestionResults,
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v2/ |
D | patricia_trie_policy.cpp | 294 const WordIdArrayView prevWordIds, const int wordId, in getWordAttributesInContext() argument 304 prevWordIds, wordId, ptNodeParams.getProbability()); in getWordAttributesInContext() 307 if (!prevWordIds.empty()) { in getWordAttributesInContext() 308 const int bigramProbability = getProbabilityOfWord(prevWordIds, wordId); in getWordAttributesInContext() 339 int PatriciaTriePolicy::getProbabilityOfWord(const WordIdArrayView prevWordIds, in getProbabilityOfWord() argument 352 if (!prevWordIds.empty()) { in getProbabilityOfWord() 354 getTerminalPtNodePosFromWordId(prevWordIds[0])); in getProbabilityOfWord() 368 void PatriciaTriePolicy::iterateNgramEntries(const WordIdArrayView prevWordIds, in iterateNgramEntries() argument 370 if (prevWordIds.empty()) { in iterateNgramEntries() 374 getTerminalPtNodePosFromWordId(prevWordIds[0])); in iterateNgramEntries()
|
D | patricia_trie_policy.h | 67 const WordAttributes getWordAttributesInContext(const WordIdArrayView prevWordIds, 72 int getProbabilityOfWord(const WordIdArrayView prevWordIds, const int wordId) const; 74 void iterateNgramEntries(const WordIdArrayView prevWordIds,
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/interface/ |
D | dictionary_structure_with_buffer_policy.h | 60 virtual const WordAttributes getWordAttributesInContext(const WordIdArrayView prevWordIds, 66 virtual int getProbabilityOfWord(const WordIdArrayView prevWordIds, const int wordId) const = 0; 68 virtual void iterateNgramEntries(const WordIdArrayView prevWordIds,
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/pt_common/ |
D | dynamic_pt_updating_helper.cpp | 96 const WordIdArrayView prevWordIds(prevWordTerminalIds, prevWordsPtNodePos.size()); in addNgramEntry() local 99 return mPtNodeWriter->addNgramEntry(prevWordIds, wordId, ngramProperty, outAddedNewEntry); in addNgramEntry() 113 const WordIdArrayView prevWordIds(prevWordTerminalIds, prevWordsPtNodePos.size()); in removeNgramEntry() local 116 return mPtNodeWriter->removeNgramEntry(prevWordIds, wordId); in removeNgramEntry()
|
D | pt_node_writer.h | 74 virtual bool addNgramEntry(const WordIdArrayView prevWordIds, const int wordId, 77 virtual bool removeNgramEntry(const WordIdArrayView prevWordIds, const int wordId) = 0;
|
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/dicnode/ |
D | dic_node_utils.cpp | 31 const WordIdArrayView prevWordIds, DicNode *const newRootDicNode) { in initAsRoot() argument 32 newRootDicNode->initAsRoot(dictionaryStructurePolicy->getRootPosition(), prevWordIds); in initAsRoot()
|
D | dic_node_utils.h | 34 const WordIdArrayView prevWordIds, DicNode *const newRootDicNode);
|
D | dic_node.h | 108 void initAsRoot(const int rootPtNodeArrayPos, const WordIdArrayView prevWordIds) { in initAsRoot() argument 110 mDicNodeProperties.init(rootPtNodeArrayPos, prevWordIds); in initAsRoot()
|