Home
last modified time | relevance | path

Searched refs:codePoints (Results 1 – 25 of 48) sorted by relevance

12

/packages/inputmethods/LatinIME/native/dicttoolkit/tests/utils/
Dutf8_utils_test.cpp31 const std::vector<int> codePoints = Utf8Utils::getCodePoints(""); in TEST() local
32 EXPECT_EQ(0u, codePoints.size()); in TEST()
35 const std::vector<int> codePoints = Utf8Utils::getCodePoints("test"); in TEST() local
36 EXPECT_EQ(4u, codePoints.size()); in TEST()
37 EXPECT_EQ('t', codePoints[0]); in TEST()
38 EXPECT_EQ('e', codePoints[1]); in TEST()
39 EXPECT_EQ('s', codePoints[2]); in TEST()
40 EXPECT_EQ('t', codePoints[3]); in TEST()
43 const std::vector<int> codePoints = Utf8Utils::getCodePoints(u8"\u3042a\u03C2\u0410"); in TEST() local
44 EXPECT_EQ(4u, codePoints.size()); in TEST()
[all …]
/packages/inputmethods/LatinIME/native/dicttoolkit/src/offdevice_intermediate_dict/
Doffdevice_intermediate_dict.cpp25 const CodePointArrayView codePoints = wordProperty.getCodePoints(); in addWord() local
26 if (codePoints.empty() || codePoints.size() > MAX_WORD_LENGTH) { in addWord()
29 return addWordInner(codePoints, wordProperty, mRootPtNodeArray); in addWord()
32 bool OffdeviceIntermediateDict::addWordInner(const CodePointArrayView codePoints, in addWordInner() argument
39 if (codePoints[0] < ptNodeCodePoints[0]) { in addWordInner()
42 if (codePoints[0] > ptNodeCodePoints[0]) { in addWordInner()
46 for (; i < codePoints.size(); ++i) { in addWordInner()
49 return addWordInner(codePoints.skip(i), wordProperty, in addWordInner()
52 if (codePoints[i] != ptNodeCodePoints[i]) { in addWordInner()
56 if (codePoints.size() == i && codePoints.size() == ptNodeCodePoints.size()) { in addWordInner()
[all …]
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/dictionary/
Ddictionary.cpp103 int Dictionary::getProbability(const CodePointArrayView codePoints) const { in getProbability()
104 return getNgramProbability(nullptr /* ngramContext */, codePoints); in getProbability()
107 int Dictionary::getMaxProbabilityOfExactMatches(const CodePointArrayView codePoints) const { in getMaxProbabilityOfExactMatches()
110 mDictionaryStructureWithBufferPolicy.get(), codePoints); in getMaxProbabilityOfExactMatches()
114 const CodePointArrayView codePoints) const { in getNgramProbability()
116 const int wordId = mDictionaryStructureWithBufferPolicy->getWordId(codePoints, in getNgramProbability()
129 bool Dictionary::addUnigramEntry(const CodePointArrayView codePoints, in addUnigramEntry() argument
138 return mDictionaryStructureWithBufferPolicy->addUnigramEntry(codePoints, unigramProperty); in addUnigramEntry()
141 bool Dictionary::removeUnigramEntry(const CodePointArrayView codePoints) { in removeUnigramEntry() argument
143 return mDictionaryStructureWithBufferPolicy->removeUnigramEntry(codePoints); in removeUnigramEntry()
[all …]
Ddictionary.h77 int getProbability(const CodePointArrayView codePoints) const;
79 int getMaxProbabilityOfExactMatches(const CodePointArrayView codePoints) const;
82 const CodePointArrayView codePoints) const;
84 bool addUnigramEntry(const CodePointArrayView codePoints,
87 bool removeUnigramEntry(const CodePointArrayView codePoints);
92 const CodePointArrayView codePoints);
95 const CodePointArrayView codePoints, const bool isValidWord,
107 const WordProperty getWordProperty(const CodePointArrayView codePoints);
/packages/inputmethods/LatinIME/native/jni/src/utils/
Dchar_utils.h56 static AK_FORCE_INLINE int getCodePointCount(const int arraySize, const int *const codePoints) { in getCodePointCount() argument
59 if (codePoints[size] == '\0') { in getCodePointCount()
89 static AK_FORCE_INLINE int attachBeginningOfSentenceMarker(int *const codePoints, in attachBeginningOfSentenceMarker() argument
91 if (codePointCount > 0 && codePoints[0] == CODE_POINT_BEGINNING_OF_SENTENCE) { in attachBeginningOfSentenceMarker()
99 memmove(codePoints + 1, codePoints, sizeof(int) * codePointCount); in attachBeginningOfSentenceMarker()
100 codePoints[0] = CODE_POINT_BEGINNING_OF_SENTENCE; in attachBeginningOfSentenceMarker()
105 static AK_FORCE_INLINE int removeBeginningOfSentenceMarker(int *const codePoints, in removeBeginningOfSentenceMarker() argument
107 if (codePointCount <= 0 || codePoints[0] != CODE_POINT_BEGINNING_OF_SENTENCE) { in removeBeginningOfSentenceMarker()
111 memmove(codePoints, codePoints + 1, sizeof(int) * newCodePointCount); in removeBeginningOfSentenceMarker()
Djni_data_utils.cpp32 const CodePointArrayView codePoints = wordProperty.getCodePoints(); in outputWordProperty() local
34 MAX_WORD_LENGTH /* maxLength */, codePoints.data(), codePoints.size(), in outputWordProperty()
62 const CodePointArrayView codePoints = ngramContext->getNthPrevWordCodePoints(i + 1); in outputWordProperty() local
63 jintArray prevWordCodePoints = env->NewIntArray(codePoints.size()); in outputWordProperty()
65 codePoints.size(), codePoints.data(), codePoints.size(), in outputWordProperty()
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/pt_common/
Dpt_node_params.h61 const int codePointCount, const int *const codePoints, const int probability, in PtNodeParams() argument
71 memcpy(mCodePoints, codePoints, sizeof(int) * mCodePointCount); in PtNodeParams()
76 const int parentPos, const int codePointCount, const int *const codePoints, in PtNodeParams() argument
86 memcpy(mCodePoints, codePoints, sizeof(int) * mCodePointCount); in PtNodeParams()
92 const CodePointArrayView codePoints, const int probability) in PtNodeParams() argument
94 mParentPos(parentPos), mCodePointCount(codePoints.size()), mCodePoints(), in PtNodeParams()
105 memcpy(mCodePoints, codePoints.data(), sizeof(int) * mCodePointCount); in PtNodeParams()
109 const CodePointArrayView codePoints, const int probability) in PtNodeParams() argument
111 mCodePointCount(codePoints.size()), mCodePoints(), in PtNodeParams()
118 memcpy(mCodePoints, codePoints.data(), sizeof(int) * mCodePointCount); in PtNodeParams()
Ddynamic_pt_updating_helper.cpp165 const CodePointArrayView codePoints) { in createChildrenPtNodeArrayAndAChildPtNode() argument
170 return createNewPtNodeArrayWithAChildPtNode(parentPtNodeParams->getHeadPos(), codePoints, in createChildrenPtNodeArrayAndAChildPtNode()
281 const CodePointArrayView codePoints, const int probability) const { in getUpdatedPtNodeParams() argument
284 false /* hasBigrams */, codePoints.size() > 1u /* hasMultipleChars */, in getUpdatedPtNodeParams()
286 return PtNodeParams(originalPtNodeParams, flags, parentPos, codePoints, probability); in getUpdatedPtNodeParams()
291 const CodePointArrayView codePoints, const int probability) const { in getPtNodeParamsForNewPtNode() argument
294 false /* hasBigrams */, codePoints.size() > 1u /* hasMultipleChars */, in getPtNodeParamsForNewPtNode()
296 return PtNodeParams(flags, parentPos, codePoints, probability); in getPtNodeParamsForNewPtNode()
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/
DBinaryDictionary.java361 final int[] codePoints = StringUtils.toCodePointArray(word); in getFrequency() local
362 return getProbabilityNative(mNativeDict, codePoints); in getFrequency()
370 final int[] codePoints = StringUtils.toCodePointArray(word); in getMaxFrequencyOfExactMatches() local
371 return getMaxProbabilityOfExactMatchesNative(mNativeDict, codePoints); in getMaxFrequencyOfExactMatches()
395 final int[] codePoints = StringUtils.toCodePointArray(word); in getWordProperty() local
407 getWordPropertyNative(mNativeDict, codePoints, isBeginningOfSentence, outCodePoints, in getWordProperty()
411 return new WordProperty(codePoints, in getWordProperty()
435 final int[] codePoints = new int[DICTIONARY_MAX_WORD_LENGTH]; in getNextWordProperty() local
437 final int nextToken = getNextWordNative(mNativeDict, token, codePoints, in getNextWordProperty()
439 final String word = StringUtils.getStringFromNullTerminatedCodePointArray(codePoints); in getNextWordProperty()
[all …]
DWordComposer.java238 final int[] codePoints = StringUtils.toCodePointArray(mTypedWordCache); in moveCursorByAndReturnIfInsideComposingWord() local
242 while (actualMoveAmount < expectedMoveAmount && cursorPos < codePoints.length) { in moveCursorByAndReturnIfInsideComposingWord()
243 actualMoveAmount += Character.charCount(codePoints[cursorPos]); in moveCursorByAndReturnIfInsideComposingWord()
251 actualMoveAmount -= Character.charCount(codePoints[cursorPos]); in moveCursorByAndReturnIfInsideComposingWord()
290 public void setComposingWord(final int[] codePoints, final int[] coordinates) { in setComposingWord() argument
292 final int length = codePoints.length; in setComposingWord()
295 processEvent(Event.createEventForCodePointFromAlreadyTypedText(codePoints[i], in setComposingWord()
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/makedict/
DFusionDictionary.java251 final int[] codePoints = new int[Character.codePointCount(characters, 0, length)]; in getCodePoints() local
256 codePoints[dsti] = codePoint; in getCodePoints()
259 codePoints[dsti] = codePoint; in getCodePoints()
260 return codePoints; in getCodePoints()
508 final int[] codePoints = getCodePoints(string); in findWordInTree() local
512 int indexOfGroup = findIndexOfChar(nodeArray, codePoints[index]); in findWordInTree()
516 if (codePoints.length - index < currentPtNode.mChars.length) return null; in findWordInTree()
518 while (newIndex < codePoints.length && newIndex - index < currentPtNode.mChars.length) { in findWordInTree()
519 if (currentPtNode.mChars[newIndex - index] != codePoints[newIndex]) return null; in findWordInTree()
527 if (index < codePoints.length) { in findWordInTree()
[all …]
/packages/inputmethods/LatinIME/common/src/com/android/inputmethod/latin/common/
DStringUtils.java253 final int[] codePoints = in toCodePointArray() local
255 copyCodePointsAndReturnCodePointCount(codePoints, charSequence, startIndex, endIndex, in toCodePointArray()
257 return codePoints; in toCodePointArray()
295 final int[] codePoints = toCodePointArray(string); in toSortedCodePointArray() local
296 Arrays.sort(codePoints); in toSortedCodePointArray()
297 return codePoints; in toSortedCodePointArray()
309 @Nonnull final int[] codePoints) { in getStringFromNullTerminatedCodePointArray()
310 int stringLength = codePoints.length; in getStringFromNullTerminatedCodePointArray()
311 for (int i = 0; i < codePoints.length; i++) { in getStringFromNullTerminatedCodePointArray()
312 if (codePoints[i] == 0) { in getStringFromNullTerminatedCodePointArray()
[all …]
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v4/shortcut/
Dver4_shortcut_list_policy.h56 bool addNewShortcut(const int terminalId, const int *const codePoints, const int codePointCount, in addNewShortcut() argument
66 return mShortcutDictContent->writeShortcutEntry(codePoints, codePointCount, probability, in addNewShortcut()
70 codePoints, codePointCount); in addNewShortcut()
79 if (!mShortcutDictContent->writeShortcutEntryAndAdvancePosition(codePoints, in addNewShortcut()
91 if (!mShortcutDictContent->writeShortcutEntry(codePoints, in addNewShortcut()
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/backward/v402/shortcut/
Dver4_shortcut_list_policy.h66 bool addNewShortcut(const int terminalId, const int *const codePoints, const int codePointCount, in addNewShortcut() argument
76 return mShortcutDictContent->writeShortcutEntry(codePoints, codePointCount, probability, in addNewShortcut()
80 codePoints, codePointCount); in addNewShortcut()
89 if (!mShortcutDictContent->writeShortcutEntryAndAdvancePosition(codePoints, in addNewShortcut()
101 if (!mShortcutDictContent->writeShortcutEntry(codePoints, in addNewShortcut()
/packages/inputmethods/LatinIME/native/dicttoolkit/src/utils/
Dutf8_utils.cpp35 std::vector<int> codePoints; in getCodePoints() local
59 codePoints.push_back(codePoint); in getCodePoints()
62 return codePoints; in getCodePoints()
84 /* static */ std::string Utf8Utils::getUtf8String(const CodePointArrayView codePoints) { in getUtf8String() argument
86 for (const int codePoint : codePoints) { in getUtf8String()
/packages/inputmethods/LatinIME/native/dicttoolkit/tests/offdevice_intermediate_dict/
Doffdevice_intermediate_dict_test.cpp31 std::vector<int> codePoints; in getCodePointVector() local
33 codePoints.push_back(*str); in getCodePointVector()
36 return codePoints; in getCodePointVector()
39 const WordProperty getDummpWordProperty(const std::vector<int> &&codePoints) { in getDummpWordProperty() argument
40 return WordProperty(std::move(codePoints), UnigramProperty(), std::vector<NgramProperty>()); in getDummpWordProperty()
/packages/inputmethods/LatinIME/native/jni/
Dcom_android_inputmethod_latin_BinaryDictionary.cpp268 int codePoints[codePointCount]; in latinime_BinaryDictionary_getProbability() local
269 env->GetIntArrayRegion(word, 0, codePointCount, codePoints); in latinime_BinaryDictionary_getProbability()
270 return dictionary->getProbability(CodePointArrayView(codePoints, codePointCount)); in latinime_BinaryDictionary_getProbability()
278 int codePoints[codePointCount]; in latinime_BinaryDictionary_getMaxProbabilityOfExactMatches() local
279 env->GetIntArrayRegion(word, 0, codePointCount, codePoints); in latinime_BinaryDictionary_getMaxProbabilityOfExactMatches()
281 CodePointArrayView(codePoints, codePointCount)); in latinime_BinaryDictionary_getMaxProbabilityOfExactMatches()
368 int codePoints[codePointCount]; in latinime_BinaryDictionary_addUnigramEntry() local
369 env->GetIntArrayRegion(word, 0, codePointCount, codePoints); in latinime_BinaryDictionary_addUnigramEntry()
382 return dictionary->addUnigramEntry(CodePointArrayView(codePoints, codePointCount), in latinime_BinaryDictionary_addUnigramEntry()
393 int codePoints[codePointCount]; in latinime_BinaryDictionary_removeUnigramEntry() local
[all …]
/packages/inputmethods/LatinIME/native/jni/src/dictionary/property/
Dngram_context.cpp95 int codePoints[MAX_WORD_LENGTH]; in getWordId() local
97 memmove(codePoints, wordCodePoints, sizeof(int) * codePointCount); in getWordId()
99 codePointCount = CharUtils::attachBeginningOfSentenceMarker(codePoints, codePointCount, in getWordId()
105 const CodePointArrayView codePointArrayView(codePoints, codePointCount); in getWordId()
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/result/
Dsuggestion_results.cpp51 void SuggestionResults::addPrediction(const int *const codePoints, const int codePointCount, in addPrediction() argument
57 addSuggestion(codePoints, codePointCount, probability, Dictionary::KIND_PREDICTION, in addPrediction()
61 void SuggestionResults::addSuggestion(const int *const codePoints, const int codePointCount, in addSuggestion() argument
79 mSuggestedWords.push(SuggestedWord(codePoints, codePointCount, score, type, in addSuggestion()
Dsuggested_word.h42 SuggestedWord(const int *const codePoints, const int codePointCount, in SuggestedWord() argument
45 : mCodePoints(codePoints, codePoints + codePointCount), mScore(score), in SuggestedWord()
/packages/inputmethods/LatinIME/native/jni/tests/dictionary/header/
Dheader_read_write_utils_test.cpp71 const std::vector<int> codePoints = { 0x0, 0x20, 0x1F, 0x100000 }; in TEST() local
72 HeaderReadWriteUtils::setCodePointVectorAttribute(&attributeMap, "abc", codePoints); in TEST()
73 EXPECT_EQ(codePoints, HeaderReadWriteUtils::readCodePointVectorAttributeValue( in TEST()
/packages/inputmethods/LatinIME/native/jni/src/dictionary/utils/
Dbyte_array_utils.h213 const int *const codePoints, const int codePointCount, const bool writesTerminator, in writeCodePointsAndAdvancePosition() argument
216 const int codePoint = codePoints[i]; in writeCodePointsAndAdvancePosition()
233 static int calculateRequiredByteCountToStoreCodePoints(const int *const codePoints, in calculateRequiredByteCountToStoreCodePoints() argument
237 const int codePoint = codePoints[i]; in calculateRequiredByteCountToStoreCodePoints()
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v4/
Dver4_patricia_trie_node_reader.cpp53 int codePoints[MAX_WORD_LENGTH]; in fetchPtNodeInfoFromBufferAndProcessMovedPtNode() local
56 dictBuf, flags, MAX_WORD_LENGTH, nullptr /* codePointTable */, codePoints, &pos); in fetchPtNodeInfoFromBufferAndProcessMovedPtNode()
85 return PtNodeParams(headPos, flags, parentPos, codePointCount, codePoints, in fetchPtNodeInfoFromBufferAndProcessMovedPtNode()
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/backward/v402/
Dver4_patricia_trie_node_reader.cpp62 int codePoints[MAX_WORD_LENGTH]; in fetchPtNodeInfoFromBufferAndProcessMovedPtNode() local
64 dictBuf, flags, MAX_WORD_LENGTH, mHeaderPolicy->getCodePointTable(), codePoints, &pos); in fetchPtNodeInfoFromBufferAndProcessMovedPtNode()
102 return PtNodeParams(headPos, flags, parentPos, codePointCount, codePoints, in fetchPtNodeInfoFromBufferAndProcessMovedPtNode()
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v4/content/
Dshortcut_dict_content.cpp104 int codePoints[MAX_WORD_LENGTH]; in copyShortcutListFromDictContent() local
109 codePoints, &codePointCount, &probability, &hasNext, &readingPos); in copyShortcutListFromDictContent()
110 if (!writeShortcutEntryAndAdvancePosition(codePoints, codePointCount, probability, in copyShortcutListFromDictContent()

12