/packages/inputmethods/LatinIME/native/jni/src/suggest/core/dictionary/ |
D | dictionary.cpp | 49 int inputSize, const NgramContext *const ngramContext, in getSuggestions() argument 53 traverseSession->init(this, ngramContext, suggestOptions); in getSuggestions() 61 const NgramContext *const ngramContext, const WordIdArrayView prevWordIds, in NgramListenerForPrediction() argument 64 : mNgramContext(ngramContext), mPrevWordIds(prevWordIds), in NgramListenerForPrediction() 91 void Dictionary::getPredictions(const NgramContext *const ngramContext, in getPredictions() argument 95 const WordIdArrayView prevWordIds = ngramContext->getPrevWordIds( in getPredictions() 98 NgramListenerForPrediction listener(ngramContext, prevWordIds, outSuggestionResults, in getPredictions() 113 int Dictionary::getNgramProbability(const NgramContext *const ngramContext, in getNgramProbability() argument 119 if (!ngramContext) { in getNgramProbability() 123 const WordIdArrayView prevWordIds = ngramContext->getPrevWordIds( in getNgramProbability() [all …]
|
D | dictionary.h | 70 int inputSize, const NgramContext *const ngramContext, 74 void getPredictions(const NgramContext *const ngramContext, 81 int getNgramProbability(const NgramContext *const ngramContext, 91 bool removeNgramEntry(const NgramContext *const ngramContext, 94 bool updateEntriesForWordWithNgramContext(const NgramContext *const ngramContext, 126 NgramListenerForPrediction(const NgramContext *const ngramContext,
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/ |
D | WordInputEventForPersonalization.java | 48 final NgramContext ngramContext, final int timestamp) { in WordInputEventForPersonalization() argument 50 mPrevWordsCount = ngramContext.getPrevWordCount(); in WordInputEventForPersonalization() 51 ngramContext.outputToArray(mPrevWordArray, mIsPrevWordBeginningOfSentenceArray); in WordInputEventForPersonalization() 62 NgramContext ngramContext = NgramContext.EMPTY_PREV_WORDS_INFO; in createInputEventFrom() local 80 ngramContext = NgramContext.EMPTY_PREV_WORDS_INFO; in createInputEventFrom() 88 ngramContext, tempWord, timestamp, locale); in createInputEventFrom() 93 ngramContext = ngramContext.getNextNgramContext(new NgramContext.WordInfo(tempWord)); in createInputEventFrom() 99 final NgramContext ngramContext, final String targetWord, final int timestamp, in detectWhetherVaildWordOrNotAndGetInputEvent() argument 104 return new WordInputEventForPersonalization(targetWord, ngramContext, timestamp); in detectWhetherVaildWordOrNotAndGetInputEvent()
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/ |
D | BinaryDictionary.java | 269 final NgramContext ngramContext, final long proximityInfoHandle, in getSuggestions() argument 278 ngramContext.outputToArray(session.mPrevWordCodePointArrays, in getSuggestions() 311 session.mIsBeginningOfSentenceArray, ngramContext.getPrevWordCount(), in getSuggestions() 375 public boolean isValidNgram(final NgramContext ngramContext, final String word) { in isValidNgram() argument 376 return getNgramProbability(ngramContext, word) != NOT_A_PROBABILITY; in isValidNgram() 379 public int getNgramProbability(final NgramContext ngramContext, final String word) { in getNgramProbability() argument 380 if (!ngramContext.isValid() || TextUtils.isEmpty(word)) { in getNgramProbability() 383 final int[][] prevWordCodePointArrays = new int[ngramContext.getPrevWordCount()][]; in getNgramProbability() 384 final boolean[] isBeginningOfSentenceArray = new boolean[ngramContext.getPrevWordCount()]; in getNgramProbability() 385 ngramContext.outputToArray(prevWordCodePointArrays, isBeginningOfSentenceArray); in getNgramProbability() [all …]
|
D | ContactsBinaryDictionary.java | 135 NgramContext ngramContext = NgramContext.getEmptyPrevWordsContext( in addNameLocked() local 151 Log.d(TAG, "addName " + name + ", " + word + ", " + ngramContext); in addNameLocked() 158 if (ngramContext.isValid() && mUseFirstLastBigrams) { in addNameLocked() 160 addNgramEntryLocked(ngramContext, in addNameLocked() 165 ngramContext = ngramContext.getNextNgramContext( in addNameLocked()
|
D | ExpandableBinaryDictionary.java | 340 public void addNgramEntry(@Nonnull final NgramContext ngramContext, final String word, in addNgramEntry() argument 350 addNgramEntryLocked(ngramContext, word, frequency, timestamp); in addNgramEntry() 355 protected void addNgramEntryLocked(@Nonnull final NgramContext ngramContext, final String word, in addNgramEntryLocked() argument 357 if (!mBinaryDictionary.addNgramEntry(ngramContext, word, frequency, timestamp)) { in addNgramEntryLocked() 360 Log.i(TAG, " NgramContext: " + ngramContext + ", word: " + word); in addNgramEntryLocked() 368 public void updateEntriesForWord(@Nonnull final NgramContext ngramContext, in updateEntriesForWord() argument 377 if (!binaryDictionary.updateEntriesForWordWithNgramContext(ngramContext, word, in updateEntriesForWord() 381 + " context: " + ngramContext.toString()); in updateEntriesForWord() 430 final NgramContext ngramContext, final long proximityInfoHandle, in getSuggestions() argument 443 mBinaryDictionary.getSuggestions(composedData, ngramContext, in getSuggestions()
|
D | Suggest.java | 99 final NgramContext ngramContext, final Keyboard keyboard, in getSuggestedWords() argument 104 getSuggestedWordsForBatchInput(wordComposer, ngramContext, keyboard, in getSuggestedWords() 107 getSuggestedWordsForNonBatchInput(wordComposer, ngramContext, keyboard, in getSuggestedWords() 153 final NgramContext ngramContext, final Keyboard keyboard, in getSuggestedWordsForNonBatchInput() argument 165 wordComposer.getComposedDataSnapshot(), ngramContext, keyboard, in getSuggestedWordsForNonBatchInput() 290 final NgramContext ngramContext, final Keyboard keyboard, in getSuggestedWordsForBatchInput() argument 295 wordComposer.getComposedDataSnapshot(), ngramContext, keyboard, in getSuggestedWordsForBatchInput()
|
D | DictionaryFacilitatorImpl.java | 500 @Nonnull final NgramContext ngramContext, final long timeStampInSeconds, in addToUserHistory() argument 507 NgramContext ngramContextForCurrentWord = ngramContext; in addToUserHistory() 543 final NgramContext ngramContext, final String word, final boolean wasAutoCapitalized, in addWordToUserHistory() argument 589 UserHistoryDictionary.addToDictionary(userHistoryDictionary, ngramContext, secondWord, in addWordToUserHistory() 602 @Nonnull final NgramContext ngramContext, final long timeStampInSeconds, in unlearnFromUserHistory() argument 617 NgramContext ngramContext, @Nonnull final Keyboard keyboard, in getSuggestionResults() argument 622 SuggestedWords.MAX_SUGGESTIONS, ngramContext.isBeginningOfSentenceContext(), in getSuggestionResults() 633 dictionary.getSuggestions(composedData, ngramContext, in getSuggestionResults()
|
D | DictionaryFacilitator.java | 152 @Nonnull final NgramContext ngramContext, final long timeStampInSeconds, in addToUserHistory() argument 156 @Nonnull final NgramContext ngramContext, final long timeStampInSeconds, in unlearnFromUserHistory() argument 161 final NgramContext ngramContext, @Nonnull final Keyboard keyboard, in getSuggestionResults() argument
|
D | DictionaryCollection.java | 63 final NgramContext ngramContext, final long proximityInfoHandle, in getSuggestions() argument 72 ngramContext, proximityInfoHandle, settingsValuesForSuggestion, sessionId, in getSuggestions() 78 composedData, ngramContext, proximityInfoHandle, settingsValuesForSuggestion, in getSuggestions()
|
D | LastComposedWord.java | 69 final NgramContext ngramContext, final int capitalizedMode) { in LastComposedWord() argument 78 mNgramContext = ngramContext; in LastComposedWord()
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v4/ |
D | ver4_patricia_trie_policy.cpp | 282 const NgramContext *const ngramContext = ngramProperty->getNgramContext(); in addNgramEntry() local 283 if (!ngramContext->isValid()) { in addNgramEntry() 293 const WordIdArrayView prevWordIds = ngramContext->getPrevWordIds(this, &prevWordIdArray, in addNgramEntry() 302 if (!ngramContext->isNthPrevWordBeginningOfSentence(i + 1 /* n */)) { in addNgramEntry() 309 if (!addUnigramEntry(ngramContext->getNthPrevWordCodePoints(1 /* n */), in addNgramEntry() 315 ngramContext->getPrevWordIds(this, &prevWordIdArray, false /* tryLowerCaseSearch */); in addNgramEntry() 334 bool Ver4PatriciaTriePolicy::removeNgramEntry(const NgramContext *const ngramContext, in removeNgramEntry() argument 345 if (!ngramContext->isValid()) { in removeNgramEntry() 354 const WordIdArrayView prevWordIds = ngramContext->getPrevWordIds(this, &prevWordIdArray, in removeNgramEntry() 373 const NgramContext *const ngramContext, const CodePointArrayView wordCodePoints, in updateEntriesForWordWithNgramContext() argument [all …]
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/backward/v402/ |
D | ver4_patricia_trie_policy.cpp | 357 const NgramContext *const ngramContext = ngramProperty->getNgramContext(); in addNgramEntry() local 358 if (!ngramContext->isValid()) { in addNgramEntry() 368 const WordIdArrayView prevWordIds = ngramContext->getPrevWordIds(this, &prevWordIdArray, in addNgramEntry() 374 if (ngramContext->isNthPrevWordBeginningOfSentence(1 /* n */)) { in addNgramEntry() 378 if (!addUnigramEntry(ngramContext->getNthPrevWordCodePoints(1 /* n */), in addNgramEntry() 384 ngramContext->getPrevWordIds(this, &prevWordIdArray, false /* tryLowerCaseSearch */); in addNgramEntry() 408 bool Ver4PatriciaTriePolicy::removeNgramEntry(const NgramContext *const ngramContext, in removeNgramEntry() argument 419 if (!ngramContext->isValid()) { in removeNgramEntry() 428 const WordIdArrayView prevWordIds = ngramContext->getPrevWordIds(this, &prevWordIdArray, in removeNgramEntry() 450 const NgramContext *const ngramContext, const CodePointArrayView wordCodePoints, in updateEntriesForWordWithNgramContext() argument [all …]
|
/packages/inputmethods/LatinIME/native/jni/src/utils/ |
D | jni_data_utils.cpp | 56 const NgramContext *const ngramContext = ngramProperty.getNgramContext(); in outputWordProperty() local 58 ngramContext->getPrevWordCount(), intArrayClass, nullptr); in outputWordProperty() 60 env->NewBooleanArray(ngramContext->getPrevWordCount()); in outputWordProperty() 61 for (size_t i = 0; i < ngramContext->getPrevWordCount(); ++i) { in outputWordProperty() 62 const CodePointArrayView codePoints = ngramContext->getNthPrevWordCodePoints(i + 1); in outputWordProperty() 70 ngramContext->isNthPrevWordBeginningOfSentence(i + 1)); in outputWordProperty()
|
/packages/inputmethods/LatinIME/native/jni/ |
D | com_android_inputmethod_latin_BinaryDictionary.cpp | 245 const NgramContext ngramContext = JniDataUtils::constructNgramContext(env, in latinime_BinaryDictionary_getSuggestions() local 250 times, pointerIds, inputCodePoints, inputSize, &ngramContext, in latinime_BinaryDictionary_getSuggestions() 253 dictionary->getPredictions(&ngramContext, &suggestionResults); in latinime_BinaryDictionary_getSuggestions() 292 const NgramContext ngramContext = JniDataUtils::constructNgramContext(env, in latinime_BinaryDictionary_getNgramProbability() local 295 return dictionary->getNgramProbability(&ngramContext, in latinime_BinaryDictionary_getNgramProbability() 405 const NgramContext ngramContext = JniDataUtils::constructNgramContext(env, in latinime_BinaryDictionary_addNgramEntry() local 412 const NgramProperty ngramProperty(ngramContext, in latinime_BinaryDictionary_addNgramEntry() 425 const NgramContext ngramContext = JniDataUtils::constructNgramContext(env, in latinime_BinaryDictionary_removeNgramEntry() local 431 return dictionary->removeNgramEntry(&ngramContext, in latinime_BinaryDictionary_removeNgramEntry() 443 const NgramContext ngramContext = JniDataUtils::constructNgramContext(env, in latinime_BinaryDictionary_updateEntriesForWordWithNgramContext() local [all …]
|
D | com_android_inputmethod_latin_DicTraverseSession.cpp | 49 NgramContext ngramContext(prevWord, previousWordLength, false /* isStartOfSentence */); in latinime_initDicTraverseSession() local 50 ts->init(dict, &ngramContext, 0 /* suggestOptions */); in latinime_initDicTraverseSession()
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/property/ |
D | ngram_context.cpp | 26 NgramContext::NgramContext(const NgramContext &ngramContext) in NgramContext() argument 27 : mPrevWordCount(ngramContext.mPrevWordCount) { in NgramContext() 29 mPrevWordCodePointCount[i] = ngramContext.mPrevWordCodePointCount[i]; in NgramContext() 30 memmove(mPrevWordCodePoints[i], ngramContext.mPrevWordCodePoints[i], in NgramContext() 32 mIsBeginningOfSentence[i] = ngramContext.mIsBeginningOfSentence[i]; in NgramContext()
|
D | ngram_property.h | 30 NgramProperty(const NgramContext &ngramContext, const std::vector<int> &&targetCodePoints, in NgramProperty() argument 32 : mNgramContext(ngramContext), mTargetCodePoints(std::move(targetCodePoints)), in NgramProperty()
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/personalization/ |
D | UserHistoryDictionaryTestsHelper.java | 102 NgramContext ngramContext = NgramContext.getEmptyPrevWordsContext( in addWordsToDictionary() local 105 UserHistoryDictionary.addToDictionary(dict, ngramContext, word, true, timestamp); in addWordsToDictionary() 106 ngramContext = ngramContext.getNextNgramContext(new WordInfo(word)); in addWordsToDictionary()
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/makedict/ |
D | WordProperty.java | 60 final NgramContext ngramContext = new NgramContext(new WordInfo(mWord)); in WordProperty() local 62 mNgrams.add(new NgramProperty(bigramTarget, ngramContext)); in WordProperty() 111 final NgramContext ngramContext = new NgramContext(wordInfoArray); in WordProperty() local 112 ngrams.add(new NgramProperty(ngramTarget, ngramContext)); in WordProperty()
|
D | NgramProperty.java | 25 public NgramProperty(final WeightedString targetWord, final NgramContext ngramContext) { in NgramProperty() argument 27 mNgramContext = ngramContext; in NgramProperty()
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/makedict/ |
D | Ver4DictEncoder.java | 93 final NgramContext ngramContext = in writeDictionary() local 95 if (!binaryDict.addNgramEntry(ngramContext, word1.mWord, in writeDictionary() 98 + ngramContext + " -> " + word1.mWord); in writeDictionary()
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/spellcheck/ |
D | AndroidSpellCheckerSession.java | 68 final NgramContext ngramContext = in fixWronglyInvalidatedWordWithSingleQuote() local 214 final NgramContext ngramContext = in onGetSuggestionsMultiple() local 217 retval[i] = onGetSuggestionsInternal(textInfo, ngramContext, suggestionsLimit); in onGetSuggestionsMultiple()
|
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/session/ |
D | dic_traverse_session.cpp | 33 const NgramContext *const ngramContext, const SuggestOptions *const suggestOptions) { in init() argument 38 mPrevWordIdCount = ngramContext->getPrevWordIds(getDictionaryStructurePolicy(), in init()
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/interface/ |
D | dictionary_structure_with_buffer_policy.h | 86 virtual bool removeNgramEntry(const NgramContext *const ngramContext, 90 virtual bool updateEntriesForWordWithNgramContext(const NgramContext *const ngramContext,
|