Home
last modified time | relevance | path

Searched refs:NgramContext (Results 1 – 25 of 49) sorted by relevance

12

/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/
DNgramContextTests.java27 import com.android.inputmethod.latin.NgramContext.WordInfo;
40 assertEquals(new NgramContext(new WordInfo("a")), new NgramContext(new WordInfo("a"))); in testConstruct()
41 assertEquals(new NgramContext(WordInfo.BEGINNING_OF_SENTENCE_WORD_INFO), in testConstruct()
42 new NgramContext(WordInfo.BEGINNING_OF_SENTENCE_WORD_INFO)); in testConstruct()
43 assertEquals(new NgramContext(WordInfo.EMPTY_WORD_INFO), in testConstruct()
44 new NgramContext(WordInfo.EMPTY_WORD_INFO)); in testConstruct()
45 assertEquals(new NgramContext(WordInfo.EMPTY_WORD_INFO), in testConstruct()
46 new NgramContext(WordInfo.EMPTY_WORD_INFO)); in testConstruct()
51 assertFalse(new NgramContext().isBeginningOfSentenceContext()); in testIsBeginningOfSentenceContext()
52 assertTrue(new NgramContext(WordInfo.BEGINNING_OF_SENTENCE_WORD_INFO) in testIsBeginningOfSentenceContext()
[all …]
DRichInputConnectionAndTextRangeTests.java174 "abc", mSpacingAndPunctuations, 2), NgramContext.BEGINNING_OF_SENTENCE); in testGetPreviousWord()
176 "abc. def", mSpacingAndPunctuations, 2), NgramContext.BEGINNING_OF_SENTENCE); in testGetPreviousWord()
214 "abc def.", mSpacingAndPunctuations, 1), NgramContext.BEGINNING_OF_SENTENCE); in testGetPreviousWord()
216 "abc def .", mSpacingAndPunctuations, 1), NgramContext.BEGINNING_OF_SENTENCE); in testGetPreviousWord()
218 "abc, def", mSpacingAndPunctuations, 2), NgramContext.EMPTY_PREV_WORDS_INFO); in testGetPreviousWord()
222 "abc? def", mSpacingAndPunctuations, 2), NgramContext.BEGINNING_OF_SENTENCE); in testGetPreviousWord()
226 "abc! def", mSpacingAndPunctuations, 2), NgramContext.BEGINNING_OF_SENTENCE); in testGetPreviousWord()
228 "abc 'def", mSpacingAndPunctuations, 2), NgramContext.EMPTY_PREV_WORDS_INFO); in testGetPreviousWord()
DBinaryDictionaryTests.java31 import com.android.inputmethod.latin.NgramContext.WordInfo;
199 binaryDictionary.addNgramEntry(new NgramContext(new WordInfo(word0)), word1, probability, in addBigramWords()
206 new NgramContext(new WordInfo(word1), new WordInfo(word0)), word2, in addTrigramEntry()
212 return binaryDictionary.isValidNgram(new NgramContext(new WordInfo(word0)), word1); in isValidBigram()
217 return binaryDictionary.getNgramProbability(new NgramContext(new WordInfo(word0)), word1); in getBigramProbability()
223 new NgramContext(new WordInfo(word1), new WordInfo(word0)), word2); in getTrigramProbability()
895 final NgramContext beginningOfSentenceContext = NgramContext.BEGINNING_OF_SENTENCE; in testBeginningOfSentence()
/packages/inputmethods/LatinIME/native/jni/src/dictionary/property/
Dngram_context.cpp24 NgramContext::NgramContext() : mPrevWordCount(0) {} in NgramContext() function in latinime::NgramContext
26 NgramContext::NgramContext(const NgramContext &ngramContext) in NgramContext() function in latinime::NgramContext
36 NgramContext::NgramContext(const int prevWordCodePoints[][MAX_WORD_LENGTH], in NgramContext() function in latinime::NgramContext
52 NgramContext::NgramContext(const int *const prevWordCodePoints, const int prevWordCodePointCount, in NgramContext() function in latinime::NgramContext
64 bool NgramContext::isValid() const { in isValid()
74 const CodePointArrayView NgramContext::getNthPrevWordCodePoints(const size_t n) const { in getNthPrevWordCodePoints()
81 bool NgramContext::isNthPrevWordBeginningOfSentence(const size_t n) const { in isNthPrevWordBeginningOfSentence()
88 /* static */ int NgramContext::getWordId( in getWordId()
117 void NgramContext::clear() { in clear()
Dngram_context.h29 class NgramContext {
32 NgramContext();
34 NgramContext(const NgramContext &ngramContext);
36 NgramContext(const int prevWordCodePoints[][MAX_WORD_LENGTH],
40 NgramContext(const int *const prevWordCodePoints, const int prevWordCodePointCount,
65 DISALLOW_ASSIGNMENT_OPERATOR(NgramContext);
Dngram_property.h30 NgramProperty(const NgramContext &ngramContext, const std::vector<int> &&targetCodePoints, in NgramProperty()
35 const NgramContext *getNgramContext() const { in getNgramContext()
56 const NgramContext mNgramContext;
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/
DNgramContext.java34 public class NgramContext { class
36 public static final NgramContext EMPTY_PREV_WORDS_INFO =
37 new NgramContext(WordInfo.EMPTY_WORD_INFO);
39 public static final NgramContext BEGINNING_OF_SENTENCE =
40 new NgramContext(WordInfo.BEGINNING_OF_SENTENCE_WORD_INFO);
46 public static NgramContext getEmptyPrevWordsContext(int maxPrevWordCount) { in getEmptyPrevWordsContext()
47 return new NgramContext(maxPrevWordCount, WordInfo.EMPTY_WORD_INFO); in getEmptyPrevWordsContext()
112 public NgramContext(final WordInfo... prevWordsInfo) { in NgramContext() method in NgramContext
116 public NgramContext(final int maxPrevWordCount, final WordInfo... prevWordsInfo) { in NgramContext() method in NgramContext
126 public NgramContext getNextNgramContext(final WordInfo wordInfo) { in getNextNgramContext()
[all …]
DDictionaryFacilitator.java152 @Nonnull final NgramContext ngramContext, final long timeStampInSeconds, in addToUserHistory()
156 @Nonnull final NgramContext ngramContext, final long timeStampInSeconds, in unlearnFromUserHistory()
161 final NgramContext ngramContext, @Nonnull final Keyboard keyboard, in getSuggestionResults()
DDictionaryFacilitatorImpl.java27 import com.android.inputmethod.latin.NgramContext.WordInfo;
500 @Nonnull final NgramContext ngramContext, final long timeStampInSeconds, in addToUserHistory()
507 NgramContext ngramContextForCurrentWord = ngramContext; in addToUserHistory()
543 final NgramContext ngramContext, final String word, final boolean wasAutoCapitalized, in addWordToUserHistory()
602 @Nonnull final NgramContext ngramContext, final long timeStampInSeconds, in unlearnFromUserHistory()
617 NgramContext ngramContext, @Nonnull final Keyboard keyboard, in getSuggestionResults()
DContactsBinaryDictionary.java135 NgramContext ngramContext = NgramContext.getEmptyPrevWordsContext( in addNameLocked()
166 new NgramContext.WordInfo(word)); in addNameLocked()
DBinaryDictionary.java269 final NgramContext ngramContext, final long proximityInfoHandle, in getSuggestions()
375 public boolean isValidNgram(final NgramContext ngramContext, final String word) { in isValidNgram()
379 public int getNgramProbability(final NgramContext ngramContext, final String word) { in getNgramProbability()
475 public boolean addNgramEntry(final NgramContext ngramContext, final String word, in addNgramEntry()
493 public boolean updateEntriesForWordWithNgramContext(@Nonnull final NgramContext ngramContext, in updateEntriesForWordWithNgramContext()
DLastComposedWord.java53 public final NgramContext mNgramContext;
69 final NgramContext ngramContext, final int capitalizedMode) { in LastComposedWord()
/packages/inputmethods/LatinIME/native/jni/src/suggest/core/dictionary/
Ddictionary.h36 class NgramContext; variable
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,
134 const NgramContext *const mNgramContext;
Ddictionary.cpp49 int inputSize, const NgramContext *const ngramContext, in getSuggestions()
61 const NgramContext *const ngramContext, const WordIdArrayView prevWordIds, in NgramListenerForPrediction()
91 void Dictionary::getPredictions(const NgramContext *const ngramContext, in getPredictions()
113 int Dictionary::getNgramProbability(const NgramContext *const ngramContext, in getNgramProbability()
151 bool Dictionary::removeNgramEntry(const NgramContext *const ngramContext, in removeNgramEntry()
157 bool Dictionary::updateEntriesForWordWithNgramContext(const NgramContext *const ngramContext, in updateEntriesForWordWithNgramContext()
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/
DWordInputEventForPersonalization.java22 import com.android.inputmethod.latin.NgramContext;
48 final NgramContext ngramContext, final int timestamp) { in WordInputEventForPersonalization()
62 NgramContext ngramContext = NgramContext.EMPTY_PREV_WORDS_INFO; in createInputEventFrom()
80 ngramContext = NgramContext.EMPTY_PREV_WORDS_INFO; in createInputEventFrom()
93 ngramContext = ngramContext.getNextNgramContext(new NgramContext.WordInfo(tempWord)); in createInputEventFrom()
99 final NgramContext ngramContext, final String targetWord, final int timestamp, in detectWhetherVaildWordOrNotAndGetInputEvent()
DNgramContextUtils.java19 import com.android.inputmethod.latin.NgramContext;
20 import com.android.inputmethod.latin.NgramContext.WordInfo;
59 public static NgramContext getNgramContextFromNthPreviousWord(final CharSequence prev, in getNgramContextFromNthPreviousWord()
61 if (prev == null) return NgramContext.EMPTY_PREV_WORDS_INFO; in getNgramContextFromNthPreviousWord()
64 return new NgramContext(WordInfo.BEGINNING_OF_SENTENCE_WORD_INFO); in getNgramContextFromNthPreviousWord()
111 return new NgramContext(prevWordsInfo); in getNgramContextFromNthPreviousWord()
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/spellcheck/
DAndroidSpellCheckerSession.java30 import com.android.inputmethod.latin.NgramContext;
68 final NgramContext ngramContext = in fixWronglyInvalidatedWordWithSingleQuote()
69 new NgramContext(new NgramContext.WordInfo(currentWord)); in fixWronglyInvalidatedWordWithSingleQuote()
214 final NgramContext ngramContext = in onGetSuggestionsMultiple()
215 new NgramContext(new NgramContext.WordInfo(prevWord)); in onGetSuggestionsMultiple()
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/makedict/
DWordProperty.java22 import com.android.inputmethod.latin.NgramContext;
23 import com.android.inputmethod.latin.NgramContext.WordInfo;
60 final NgramContext ngramContext = new NgramContext(new WordInfo(mWord)); in WordProperty()
111 final NgramContext ngramContext = new NgramContext(wordInfoArray); in WordProperty()
DNgramProperty.java19 import com.android.inputmethod.latin.NgramContext;
23 public final NgramContext mNgramContext;
25 public NgramProperty(final WeightedString targetWord, final NgramContext ngramContext) { in NgramProperty()
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/personalization/
DUserHistoryDictionaryTestsHelper.java22 import com.android.inputmethod.latin.NgramContext;
23 import com.android.inputmethod.latin.NgramContext.WordInfo;
102 NgramContext ngramContext = NgramContext.getEmptyPrevWordsContext( in addWordsToDictionary()
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/makedict/
DVer4DictEncoder.java22 import com.android.inputmethod.latin.NgramContext;
93 final NgramContext ngramContext = in writeDictionary()
94 new NgramContext(new NgramContext.WordInfo(word0Property.mWord)); in writeDictionary()
/packages/inputmethods/LatinIME/native/jni/src/dictionary/interface/
Ddictionary_structure_with_buffer_policy.h36 class NgramContext; variable
86 virtual bool removeNgramEntry(const NgramContext *const ngramContext,
90 virtual bool updateEntriesForWordWithNgramContext(const NgramContext *const ngramContext,
/packages/inputmethods/LatinIME/native/jni/
Dcom_android_inputmethod_latin_BinaryDictionary.cpp245 const NgramContext ngramContext = JniDataUtils::constructNgramContext(env, in latinime_BinaryDictionary_getSuggestions()
292 const NgramContext ngramContext = JniDataUtils::constructNgramContext(env, in latinime_BinaryDictionary_getNgramProbability()
405 const NgramContext ngramContext = JniDataUtils::constructNgramContext(env, in latinime_BinaryDictionary_addNgramEntry()
425 const NgramContext ngramContext = JniDataUtils::constructNgramContext(env, in latinime_BinaryDictionary_removeNgramEntry()
443 const NgramContext ngramContext = JniDataUtils::constructNgramContext(env, in latinime_BinaryDictionary_updateEntriesForWordWithNgramContext()
495 const NgramContext ngramContext = JniDataUtils::constructNgramContext(env, in latinime_BinaryDictionary_updateEntriesForInputEvents()
Dcom_android_inputmethod_latin_DicTraverseSession.cpp43 NgramContext emptyNgramContext; in latinime_initDicTraverseSession()
49 NgramContext ngramContext(prevWord, previousWordLength, false /* isStartOfSentence */); in latinime_initDicTraverseSession()
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v4/
Dver4_patricia_trie_policy.cpp282 const NgramContext *const ngramContext = ngramProperty->getNgramContext(); in addNgramEntry()
334 bool Ver4PatriciaTriePolicy::removeNgramEntry(const NgramContext *const ngramContext, in removeNgramEntry()
373 const NgramContext *const ngramContext, const CodePointArrayView wordCodePoints, in updateEntriesForWordWithNgramContext()
534 const NgramContext ngramContext(ngramPrevWordsCodePoints, ngramPrevWordsCodePointCount, in getWordProperty()

12