/packages/inputmethods/LatinIME/native/jni/tests/dictionary/structure/v4/content/ |
D | language_model_dict_content_test.cpp | 34 const int wordId = 100; in TEST() local 36 languageModelDictContent.setProbabilityEntry(wordId, &probabilityEntry); in TEST() 38 languageModelDictContent.getProbabilityEntry(wordId); in TEST() 43 EXPECT_TRUE(languageModelDictContent.removeProbabilityEntry(wordId)); in TEST() 44 EXPECT_FALSE(languageModelDictContent.getProbabilityEntry(wordId).isValid()); in TEST() 45 EXPECT_FALSE(languageModelDictContent.removeProbabilityEntry(wordId)); in TEST() 46 EXPECT_TRUE(languageModelDictContent.setProbabilityEntry(wordId, &probabilityEntry)); in TEST() 47 EXPECT_TRUE(languageModelDictContent.getProbabilityEntry(wordId).isValid()); in TEST() 56 const int wordId = 100; in TEST() local 59 languageModelDictContent.setProbabilityEntry(wordId, &probabilityEntry); in TEST() [all …]
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v4/ |
D | ver4_patricia_trie_policy.cpp | 61 const int wordId = isTerminal ? ptNodeParams.getTerminalId() : NOT_A_WORD_ID; in createAndGetAllChildDicNodes() local 63 wordId, ptNodeParams.getCodePointArrayView()); in createAndGetAllChildDicNodes() 72 int Ver4PatriciaTriePolicy::getCodePointsAndReturnCodePointCount(const int wordId, in getCodePointsAndReturnCodePointCount() argument 76 mBuffers->getTerminalPositionLookupTable()->getTerminalPtNodePosition(wordId); in getCodePointsAndReturnCodePointCount() 108 const WordIdArrayView prevWordIds, const int wordId, in getWordAttributesInContext() argument 110 if (wordId == NOT_A_WORD_ID) { in getWordAttributesInContext() 113 return mBuffers->getLanguageModelDictContent()->getWordAttributes(prevWordIds, wordId, in getWordAttributesInContext() 118 const int wordId) const { in getProbabilityOfWord() 119 if (wordId == NOT_A_WORD_ID || prevWordIds.contains(NOT_A_WORD_ID)) { in getProbabilityOfWord() 123 mBuffers->getLanguageModelDictContent()->getWordAttributes(prevWordIds, wordId, in getProbabilityOfWord() [all …]
|
D | ver4_patricia_trie_policy.h | 64 int getCodePointsAndReturnCodePointCount(const int wordId, const int maxCodePointCount, 70 const int wordId, MultiBigramMap *const multiBigramMap) const; 78 int getProbabilityOfWord(const WordIdArrayView prevWordIds, const int wordId) const; 83 BinaryDictionaryShortcutIterator getShortcutIterator(const int wordId) const; 146 int getShortcutPositionOfWord(const int wordId) const;
|
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() 226 const int wordId) { in removeNgramEntry() argument 229 return languageModelDictContent->removeNgramProbabilityEntry(prevWordIds, wordId); in removeNgramEntry()
|
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/v4/content/ |
D | language_model_dict_content.cpp | 43 const int wordId, const bool mustMatchAllPrevWords, in getWordAttributes() argument 58 const ProbabilityEntry unigramProbabilityEntry = getProbabilityEntry(wordId); in getWordAttributes() 67 const TrieMap::Result result = mTrieMap.get(wordId, bitmapEntryIndices[i]); in getWordAttributes() 118 const WordIdArrayView prevWordIds, const int wordId) const { in getNgramProbabilityEntry() 123 const TrieMap::Result result = mTrieMap.get(wordId, bitmapEntryIndex); in getNgramProbabilityEntry() 132 const int wordId, const ProbabilityEntry *const probabilityEntry) { in setNgramProbabilityEntry() argument 133 if (wordId == Ver4DictConstants::NOT_A_TERMINAL_ID) { in setNgramProbabilityEntry() 140 return mTrieMap.put(wordId, probabilityEntry->encode(mHasHistoricalInfo), bitmapEntryIndex); in setNgramProbabilityEntry() 144 const int wordId) { in removeNgramProbabilityEntry() argument 150 return mTrieMap.remove(wordId, bitmapEntryIndex); in removeNgramProbabilityEntry() [all …]
|
D | language_model_dict_content.h | 48 WordIdAndProbabilityEntry(const int wordId, const ProbabilityEntry &probabilityEntry) in WordIdAndProbabilityEntry() argument 49 : mWordId(wordId), mProbabilityEntry(probabilityEntry) {} in WordIdAndProbabilityEntry() 153 const WordAttributes getWordAttributes(const WordIdArrayView prevWordIds, const int wordId, 156 ProbabilityEntry getProbabilityEntry(const int wordId) const { in getProbabilityEntry() argument 157 return getNgramProbabilityEntry(WordIdArrayView(), wordId); in getProbabilityEntry() 160 bool setProbabilityEntry(const int wordId, const ProbabilityEntry *const probabilityEntry) { in setProbabilityEntry() argument 162 return setNgramProbabilityEntry(WordIdArrayView(), wordId, probabilityEntry); in setProbabilityEntry() 165 bool removeProbabilityEntry(const int wordId) { in removeProbabilityEntry() argument 166 return removeNgramProbabilityEntry(WordIdArrayView(), wordId); in removeProbabilityEntry() 170 const int wordId) const; [all …]
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v2/ |
D | patricia_trie_policy.cpp | 60 int PatriciaTriePolicy::getCodePointsAndReturnCodePointCount(const int wordId, in getCodePointsAndReturnCodePointCount() argument 62 return getCodePointsAndProbabilityAndReturnCodePointCount(wordId, maxCodePointCount, in getCodePointsAndReturnCodePointCount() 83 const int wordId, const int maxCodePointCount, int *const outCodePoints, in getCodePointsAndProbabilityAndReturnCodePointCount() argument 85 const int ptNodePos = getTerminalPtNodePosFromWordId(wordId); in getCodePointsAndProbabilityAndReturnCodePointCount() 294 const WordIdArrayView prevWordIds, const int wordId, in getWordAttributesInContext() argument 296 if (wordId == NOT_A_WORD_ID) { in getWordAttributesInContext() 299 const int ptNodePos = getTerminalPtNodePosFromWordId(wordId); in getWordAttributesInContext() 304 prevWordIds, wordId, ptNodeParams.getProbability()); in getWordAttributesInContext() 308 const int bigramProbability = getProbabilityOfWord(prevWordIds, wordId); in getWordAttributesInContext() 340 const int wordId) const { in getProbabilityOfWord() [all …]
|
D | patricia_trie_policy.h | 62 int getCodePointsAndReturnCodePointCount(const int wordId, const int maxCodePointCount, 68 const int wordId, MultiBigramMap *const multiBigramMap) const; 72 int getProbabilityOfWord(const WordIdArrayView prevWordIds, const int wordId) const; 77 BinaryDictionaryShortcutIterator getShortcutIterator(const int wordId) const; 166 int getCodePointsAndProbabilityAndReturnCodePointCount(const int wordId, 174 int getTerminalPtNodePosFromWordId(const int wordId) const;
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/backward/v402/ |
D | ver4_patricia_trie_policy.cpp | 81 const int wordId = isTerminal ? ptNodeParams.getHeadPos() : NOT_A_WORD_ID; in createAndGetAllChildDicNodes() local 83 wordId, ptNodeParams.getCodePointArrayView()); in createAndGetAllChildDicNodes() 91 int Ver4PatriciaTriePolicy::getCodePointsAndReturnCodePointCount(const int wordId, in getCodePointsAndReturnCodePointCount() argument 94 const int ptNodePos = getTerminalPtNodePosFromWordId(wordId); in getCodePointsAndReturnCodePointCount() 119 const WordIdArrayView prevWordIds, const int wordId, in getWordAttributesInContext() argument 121 if (wordId == NOT_A_WORD_ID) { in getWordAttributesInContext() 124 const int ptNodePos = getTerminalPtNodePosFromWordId(wordId); in getWordAttributesInContext() 128 prevWordIds, wordId, ptNodeParams.getProbability()); in getWordAttributesInContext() 132 const int probability = getProbabilityOfWord(prevWordIds, wordId); in getWordAttributesInContext() 161 const int wordId) const { in getProbabilityOfWord() [all …]
|
D | ver4_patricia_trie_policy.h | 89 int getCodePointsAndReturnCodePointCount(const int wordId, const int maxCodePointCount, 95 const int wordId, MultiBigramMap *const multiBigramMap) const; 99 int getProbabilityOfWord(const WordIdArrayView prevWordIds, const int wordId) const; 104 BinaryDictionaryShortcutIterator getShortcutIterator(const int wordId) const; 172 int getTerminalPtNodePosFromWordId(const int wordId) const;
|
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() 257 const int wordId) { in removeNgramEntry() argument 258 return mBigramPolicy->removeEntry(prevWordIds[0], wordId); in removeNgramEntry()
|
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/src/dictionary/interface/ |
D | dictionary_structure_with_buffer_policy.h | 54 virtual int getCodePointsAndReturnCodePointCount(const int wordId, const int maxCodePointCount, 61 const int wordId, MultiBigramMap *const multiBigramMap) const = 0; 66 virtual int getProbabilityOfWord(const WordIdArrayView prevWordIds, const int wordId) const = 0; 71 virtual BinaryDictionaryShortcutIterator getShortcutIterator(const int wordId) const = 0;
|
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/dictionary/ |
D | dictionary.cpp | 116 const int wordId = mDictionaryStructureWithBufferPolicy->getWordId(codePoints, in getNgramProbability() local 118 if (wordId == NOT_A_WORD_ID) return NOT_A_PROBABILITY; in getNgramProbability() 120 return getDictionaryStructurePolicy()->getProbabilityOfWord(WordIdArrayView(), wordId); in getNgramProbability() 126 return getDictionaryStructurePolicy()->getProbabilityOfWord(prevWordIds, wordId); in getNgramProbability()
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/pt_common/ |
D | dynamic_pt_updating_helper.cpp | 97 const int wordId = in addNgramEntry() local 99 return mPtNodeWriter->addNgramEntry(prevWordIds, wordId, ngramProperty, outAddedNewEntry); in addNgramEntry() 114 const int wordId = 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/dictionary/property/ |
D | ngram_context.cpp | 106 const int wordId = dictStructurePolicy->getWordId(codePointArrayView, in getWordId() local 108 if (wordId != NOT_A_WORD_ID || !tryLowerCaseSearch) { in getWordId() 110 return wordId; in getWordId()
|
/packages/providers/UserDictionaryProvider/src/com/android/providers/userdictionary/ |
D | UserDictionaryProvider.java | 273 String wordId = uri.getPathSegments().get(1); in delete() local 274 count = db.delete(USERDICT_TABLE_NAME, Words._ID + "=" + wordId in delete() 302 String wordId = uri.getPathSegments().get(1); in update() local 303 count = db.update(USERDICT_TABLE_NAME, values, Words._ID + "=" + wordId in update()
|
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/dicnode/ |
D | dic_node_vector.h | 63 const int wordId, const CodePointArrayView mergedCodePoints) { in pushLeavingChild() argument 66 mDicNodes.back().initAsChild(dicNode, childrenPtNodeArrayPos, wordId, mergedCodePoints); in pushLeavingChild()
|
D | dic_node.h | 139 const int wordId, const CodePointArrayView mergedCodePoints) { in initAsChild() argument 145 wordId, newDepth, newLeavingDepth, dicNode->mDicNodeProperties.getPrevWordIds()); in initAsChild()
|
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/dicnode/internal/ |
D | dic_node_properties.h | 40 void init(const int childrenPos, const int nodeCodePoint, const int wordId, in init() argument 44 mWordId = wordId; in init()
|