Home
last modified time | relevance | path

Searched refs:suggestions (Results 1 – 25 of 47) sorted by relevance

12

/packages/apps/QuickSearchBox/tests/src/com/android/quicksearchbox/
DSuggestionsProviderImplTest.java58 Suggestions suggestions = mProvider.getSuggestions("foo", in testSingleCorpus() local
60 suggestions.setShortcuts(mShortcutRepo.getShortcutsForQuery( in testSingleCorpus()
63 assertEquals(1, suggestions.getExpectedResultCount()); in testSingleCorpus()
64 assertEquals(0, suggestions.getResultCount()); in testSingleCorpus()
65 assertEquals(0, promote(suggestions).getCount()); in testSingleCorpus()
67 assertEquals(1, suggestions.getExpectedResultCount()); in testSingleCorpus()
68 assertEquals(1, suggestions.getResultCount()); in testSingleCorpus()
70 promote(suggestions).getCount()); in testSingleCorpus()
73 if (suggestions != null) suggestions.release(); in testSingleCorpus()
78 Suggestions suggestions = mProvider.getSuggestions("foo", in testMultipleCorpora() local
[all …]
DRankAwarePromoterTest.java50 List<CorpusResult> suggestions = getSuggestions(TEST_QUERY); in testPromotesExpectedSuggestions() local
53 mPromoter.promoteSuggestions(suggestions, MAX_PROMOTED_SUGGESTIONS, promoted); in testPromotesExpectedSuggestions()
62 List<CorpusResult> suggestions = getSuggestions(TEST_QUERY); in testWhenPromotingAlreadyPromotedResults() local
72 CorpusResult corpora2 = suggestions.get(2); in testWhenPromotingAlreadyPromotedResults()
77 mPromoter.promoteSuggestions(suggestions, MAX_PROMOTED_SUGGESTIONS, promoted); in testWhenPromotingAlreadyPromotedResults()
112 List<CorpusResult> suggestions = getSuggestions(TEST_QUERY); in testPromotesRightNumberOfSuggestions() local
119 mPromoter.promoteSuggestions(suggestions, MAX_PROMOTED_SUGGESTIONS, promoted); in testPromotesRightNumberOfSuggestions()
DSuggestionCursorWithExtrasTest.java134 CursorBackedSourceResult suggestions = new CursorBackedSourceResult( in createCursorWithExtras() local
136 assertEquals("Number of suggestions", 1, suggestions.getCount()); in createCursorWithExtras()
137 suggestions.moveTo(0); in createCursorWithExtras()
138 SuggestionCursorBackedCursor observedCursor = new SuggestionCursorBackedCursor(suggestions); in createCursorWithExtras()
153 CursorBackedSourceResult suggestions = new CursorBackedSourceResult( in checkSuggestionCursorExtraColumnValue() local
157 cursor.getCount(), suggestions.getCount()); in checkSuggestionCursorExtraColumnValue()
160 suggestions.moveTo(0); in checkSuggestionCursorExtraColumnValue()
162 SuggestionExtras extras = suggestions.getExtras(); in checkSuggestionCursorExtraColumnValue()
DSingleCorpusPromoterTest.java41 Suggestions suggestions = makeSuggestions(TEST_QUERY); in testPromotesOnlyGivenCorpus() local
44 mPromoter.pickPromoted(suggestions, 4, promoted); in testPromotesOnlyGivenCorpus()
58 Suggestions suggestions = new Suggestions(query, mCorpora); in makeSuggestions() local
63 suggestions.addCorpusResults(results); in makeSuggestions()
64 return suggestions; in makeSuggestions()
DResultPromoterTest.java96 private ListSuggestionCursor promoteSuggestions(List<CorpusResult> suggestions) { in promoteSuggestions() argument
100 promoter.promoteSuggestions(suggestions, MAX_PROMOTED_SUGGESTIONS, promoted); in promoteSuggestions()
108 private SuggestionCursor cursor(Suggestion... suggestions) { in cursor() argument
109 return new ListSuggestionCursor(mQuery, suggestions); in cursor()
DWebPromoterTest.java100 private ListSuggestionCursor promote(Suggestions suggestions, int maxShortcuts, in promote() argument
104 promoter.pickPromoted(suggestions, maxSuggestions, promoted); in promote()
108 private SuggestionCursor cursor(Suggestion... suggestions) { in cursor() argument
109 return new ListSuggestionCursor(mQuery, suggestions); in cursor()
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/ui/
DDelayingSuggestionsAdapter.java54 public void setSuggestions(Suggestions suggestions) { in setSuggestions() argument
55 if (suggestions == null) { in setSuggestions()
60 if (shouldPublish(suggestions)) { in setSuggestions()
61 if (DBG) Log.d(TAG, "Publishing suggestions immediately: " + suggestions); in setSuggestions()
62 mDelayedAdapter.setSuggestions(suggestions); in setSuggestions()
66 if (DBG) Log.d(TAG, "Delaying suggestions publishing: " + suggestions); in setSuggestions()
67 setPendingSuggestions(suggestions); in setSuggestions()
74 private boolean shouldPublish(Suggestions suggestions) { in shouldPublish() argument
75 if (suggestions.isDone()) return true; in shouldPublish()
76 SuggestionCursor cursor = mDelayedAdapter.getPromoted(suggestions); in shouldPublish()
[all …]
DSuggestionsAdapterBase.java102 public void setSuggestions(Suggestions suggestions) { in setSuggestions() argument
103 if (mSuggestions == suggestions) { in setSuggestions()
107 if (suggestions != null) { in setSuggestions()
108 suggestions.release(); in setSuggestions()
120 mSuggestions = suggestions; in setSuggestions()
166 protected View getView(SuggestionCursor suggestions, int position, long suggestionId, in getView() argument
168 suggestions.moveTo(position); in getView()
169 View v = mViewFactory.getView(suggestions, suggestions.getUserQuery(), convertView, parent); in getView()
200 protected SuggestionCursor getPromoted(Suggestions suggestions) { in getPromoted() argument
201 if (suggestions == null) return null; in getPromoted()
[all …]
DSearchActivityView.java101 mSuggestionsView = (SuggestionsView) findViewById(R.id.suggestions); in onFinishInflate()
206 Suggestions suggestions = getSuggestions(); in setCorpus() local
207 if (corpus == null || suggestions == null || !suggestions.expectsCorpus(corpus)) { in setCorpus()
280 public void setSuggestions(Suggestions suggestions) { in setSuggestions() argument
281 suggestions.acquire(); in setSuggestions()
282 mSuggestionsAdapter.setSuggestions(suggestions); in setSuggestions()
431 Suggestions suggestions = mSuggestionsAdapter.getSuggestions(); in updateInputMethodSuggestions()
432 if (suggestions == null) return; in updateInputMethodSuggestions()
433 CompletionInfo[] completions = webSuggestionsToCompletions(suggestions); in updateInputMethodSuggestions()
438 private CompletionInfo[] webSuggestionsToCompletions(Suggestions suggestions) { in webSuggestionsToCompletions() argument
[all …]
DSuggestionsView.java111 int suggestions = Math.max(1, (int) Math.floor(maxHeight / suggestionHeight)); in setMaxPromotedByHeight() local
114 suggestionHeight + " -> maxSuggestions=" + suggestions); in setMaxPromotedByHeight()
116 mSuggestionsAdapter.setMaxPromoted(suggestions); in setMaxPromotedByHeight()
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/
DRankAwarePromoter.java39 public void doPickPromoted(Suggestions suggestions, in doPickPromoted() argument
41 promoteSuggestions(suggestions.getCorpusResults(), maxPromoted, promoted); in doPickPromoted()
45 void promoteSuggestions(Iterable<CorpusResult> suggestions, int maxPromoted, in promoteSuggestions() argument
47 if (DBG) Log.d(TAG, "Available results: " + suggestions); in promoteSuggestions()
53 partitionSuggestionsByRank(suggestions, highRankingSuggestions, lowRankingSuggestions); in promoteSuggestions()
92 private void promoteEquallyFromEachCorpus(LinkedList<CorpusResult> suggestions, in promoteEquallyFromEachCorpus() argument
101 if (suggestions.isEmpty()) { in promoteEquallyFromEachCorpus()
105 int stripeSize = Math.max(1, slotsLeft / suggestions.size()); in promoteEquallyFromEachCorpus()
106 roundRobin(suggestions, slotsLeft, stripeSize, promoted); in promoteEquallyFromEachCorpus()
110 roundRobin(suggestions, slotsLeft, slotsLeft, promoted); in promoteEquallyFromEachCorpus()
[all …]
DShortcutCursor.java64 ShortcutCursor(SuggestionCursor suggestions) { in ShortcutCursor() argument
65 this(suggestions, true, null, null, null); in ShortcutCursor()
68 public ShortcutCursor(SuggestionCursor suggestions, boolean allowWebSearchShortcuts, in ShortcutCursor() argument
70 this(suggestions.getUserQuery(), suggestions, uiThread, refresher, repository); in ShortcutCursor()
71 int count = suggestions.getCount(); in ShortcutCursor()
74 suggestions.moveTo(i); in ShortcutCursor()
75 if (suggestions.getSuggestionSource() != null in ShortcutCursor()
76 && (allowWebSearchShortcuts || !suggestions.isWebSearchSuggestion())) { in ShortcutCursor()
77 add(new SuggestionPosition(suggestions)); in ShortcutCursor()
DSearchActivity.java466 SuggestionCursor suggestions = pos.getCursor(); in getCurrentSuggestions() local
468 if (suggestions == null) { in getCurrentSuggestions()
471 int count = suggestions.getCount(); in getCurrentSuggestions()
476 suggestions.moveTo(position); in getCurrentSuggestions()
481 Suggestions suggestions = mSearchActivityView.getSuggestions(); in getCurrentIncludedCorpora() local
482 return suggestions == null ? null : suggestions.getIncludedCorpora(); in getCurrentIncludedCorpora()
519 protected void launchSuggestion(SuggestionCursor suggestions, int position) { in launchSuggestion() argument
520 suggestions.moveTo(position); in launchSuggestion()
521 Intent intent = SuggestionUtils.getSuggestionIntent(suggestions, mAppSearchData); in launchSuggestion()
552 protected void removeFromHistory(SuggestionCursor suggestions, int position) { in removeFromHistory() argument
[all …]
DAbstractPromoter.java34 Suggestions suggestions, int maxPromoted, ListSuggestionCursor promoted) { in pickPromoted() argument
35 doPickPromoted(suggestions, maxPromoted, promoted); in pickPromoted()
37 mNext.pickPromoted(suggestions, maxPromoted, promoted); in pickPromoted()
42 Suggestions suggestions, int maxPromoted, ListSuggestionCursor promoted); in doPickPromoted() argument
DSuggestionsProviderImpl.java111 final Suggestions suggestions = new Suggestions(query, corporaToQuery); in getSuggestions() local
116 return suggestions; in getSuggestions()
131 mBatchingExecutor, suggestions, initialBatchSize, in getSuggestions()
135 suggestions.done(); in getSuggestions()
143 return suggestions; in getSuggestions()
182 Suggestions suggestions, int initialBatchSize, in SuggestionCursorReceiver() argument
185 mSuggestions = suggestions; in SuggestionCursorReceiver()
DSingleCorpusPromoter.java41 public void pickPromoted(Suggestions suggestions, int maxPromoted, in pickPromoted() argument
44 SuggestionCursor shortcuts = suggestions.getShortcuts(); in pickPromoted()
47 CorpusResult corpusResult = suggestions.getCorpusResult(mCorpus); in pickPromoted()
DWebPromoter.java33 public void pickPromoted(Suggestions suggestions, int maxPromoted, in pickPromoted() argument
36 SuggestionCursor shortcuts = suggestions.getShortcuts(); in pickPromoted()
51 CorpusResult webResult = suggestions.getWebResult(); in pickPromoted()
DEventLogTags.logtags32 # the list of suggestions shown.
40 71002 qsb_click (id|2),(suggestions|3),(queried_sources|3),(num_chars|1),(click_type|1)
55 # @param suggestions The suggestions shown when the user left QSB. See qsb_click above.
57 71005 qsb_exit (suggestions|3),(num_chars|1)
DEventLogLogger.java72 String suggestions = getSuggestions(suggestionCursor); in logSuggestionClick() local
75 EventLogTags.writeQsbClick(id, suggestions, corpora, numChars, in logSuggestionClick()
90 String suggestions = getSuggestions(suggestionCursor); in logExit() local
91 EventLogTags.writeQsbExit(suggestions, numChars); in logExit()
DShortcutRepository.java43 void removeFromHistory(SuggestionCursor suggestions, int position); in removeFromHistory() argument
59 void reportClick(SuggestionCursor suggestions, int position); in reportClick() argument
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/
DAutoCorrection.java37 final WordComposer wordComposer, final ArrayList<SuggestedWordInfo> suggestions, in computeAutoCorrectionWord() argument
43 dictionaries, wordComposer, suggestions, consideredWord)) { in computeAutoCorrectionWord()
45 } else if (hasAutoCorrectionForBinaryDictionary(wordComposer, suggestions, in computeAutoCorrectionWord()
47 return suggestions.get(0).mWord; in computeAutoCorrectionWord()
114 final WordComposer wordComposer, final ArrayList<SuggestedWordInfo> suggestions, in hasAutoCorrectionForConsideredWord() argument
117 return wordComposer.size() > 1 && suggestions.size() > 0 in hasAutoCorrectionForConsideredWord()
122 ArrayList<SuggestedWordInfo> suggestions, in hasAutoCorrectionForBinaryDictionary() argument
124 if (wordComposer.size() > 1 && suggestions.size() > 0) { in hasAutoCorrectionForBinaryDictionary()
125 final SuggestedWordInfo autoCorrectionSuggestion = suggestions.get(0); in hasAutoCorrectionForBinaryDictionary()
DSuggest.java409 final String typedWord, final ArrayList<SuggestedWordInfo> suggestions) { in getSuggestionsInfoListWithDebugInfo() argument
410 final SuggestedWordInfo typedWordInfo = suggestions.get(0); in getSuggestionsInfoListWithDebugInfo()
412 final int suggestionsSize = suggestions.size(); in getSuggestionsInfoListWithDebugInfo()
419 final SuggestedWordInfo cur = suggestions.get(i + 1); in getSuggestionsInfoListWithDebugInfo()
439 final ArrayList<SuggestedWordInfo> suggestions; in addWord() local
442 suggestions = mBigramSuggestions; in addWord()
445 suggestions = mSuggestions; in addWord()
455 if (suggestions.size() > 0) { in addWord()
456 final SuggestedWordInfo currentHighestWord = suggestions.get(0); in addWord()
468 if (suggestions.size() >= prefMaxSuggestions in addWord()
[all …]
DStringUtils.java148 public static void removeDupes(final ArrayList<CharSequence> suggestions) { in removeDupes() argument
149 if (suggestions.size() < 2) return; in removeDupes()
152 while (i < suggestions.size()) { in removeDupes()
153 final CharSequence cur = suggestions.get(i); in removeDupes()
156 CharSequence previous = suggestions.get(j); in removeDupes()
158 suggestions.remove(i); in removeDupes()
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/suggestions/
DMoreSuggestions.java17 package com.android.inputmethod.latin.suggestions;
54 public int layout(SuggestedWords suggestions, int fromPos, int maxWidth, int minWidth, in layout() argument
66 final int size = Math.min(suggestions.size(), SuggestionsView.MAX_SUGGESTIONS); in layout()
68 final String word = suggestions.getWord(pos).toString(); in layout()
171 public Builder layout(SuggestedWords suggestions, int fromPos, int maxWidth, in layout() argument
178 final int count = mParams.layout(suggestions, fromPos, maxWidth, minWidth, maxRow, in layout()
182 mSuggestions = suggestions; in layout()
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/google/
DGoogleSuggestClient.java126 JSONArray suggestions = results.getJSONArray(1); in query() local
128 if (DBG) Log.d(LOG_TAG, "Got " + suggestions.length() + " results"); in query()
129 return new GoogleSuggestCursor(this, query, suggestions, popularity); in query()
173 JSONArray suggestions, JSONArray popularity) { in GoogleSuggestCursor() argument
175 mSuggestions = suggestions; in GoogleSuggestCursor()

12