Home
last modified time | relevance | path

Searched refs:wordId (Results 1 – 22 of 22) sorted by relevance

/packages/inputmethods/LatinIME/native/jni/tests/dictionary/structure/v4/content/
Dlanguage_model_dict_content_test.cpp34 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/
Dver4_patricia_trie_policy.cpp61 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 …]
Dver4_patricia_trie_policy.h64 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;
Dver4_patricia_trie_node_writer.cpp206 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()
Dver4_patricia_trie_node_writer.h75 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/
Dlanguage_model_dict_content.cpp43 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 …]
Dlanguage_model_dict_content.h48 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/
Dpatricia_trie_policy.cpp60 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 …]
Dpatricia_trie_policy.h62 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/
Dver4_patricia_trie_policy.cpp81 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 …]
Dver4_patricia_trie_policy.h89 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;
Dver4_patricia_trie_node_writer.cpp234 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()
Dver4_patricia_trie_node_writer.h96 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/
Ddictionary_structure_with_buffer_policy.h54 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/
Ddictionary.cpp116 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/
Ddynamic_pt_updating_helper.cpp97 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()
Dpt_node_writer.h74 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/
Dngram_context.cpp106 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/
DUserDictionaryProvider.java273 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/
Ddic_node_vector.h63 const int wordId, const CodePointArrayView mergedCodePoints) { in pushLeavingChild() argument
66 mDicNodes.back().initAsChild(dicNode, childrenPtNodeArrayPos, wordId, mergedCodePoints); in pushLeavingChild()
Ddic_node.h139 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/
Ddic_node_properties.h40 void init(const int childrenPos, const int nodeCodePoint, const int wordId, in init() argument
44 mWordId = wordId; in init()