HomeSort by relevance Sort by last modified time
    Searched full:corpus (Results 1 - 25 of 61) sorted by null

1 2 3

  /packages/apps/QuickSearchBox/tests/src/com/android/quicksearchbox/
MockCorpora.java 38 private HashMap<String,Corpus> mCorporaByName = new HashMap<String,Corpus>();
39 private HashSet<Corpus> mDefaultCorpora = new HashSet<Corpus>();
41 private Corpus mWebCorpus;
43 public void addCorpus(Corpus corpus) {
44 Corpus oldCorpus = mCorporaByName.put(corpus.getName(), corpus);
    [all...]
RankAwarePromoterTest.java 67 private List<Corpus> getRankedCorpora() {
73 for (Corpus corpus : getRankedCorpora()) {
74 suggestions.add(corpus.getSuggestions(query, 10));
83 Corpus mockCorpus = new MockCorpus(mockSource);
92 // A corpus ranker that orders corpora lexicographically by name.
100 public List<Corpus> rankCorpora(Corpora corpora) {
101 ArrayList<Corpus> ordered = new ArrayList<Corpus>(corpora.getEnabledCorpora());
102 Collections.sort(ordered, new Comparator<Corpus>() {
    [all...]
SuggestionsTest.java 53 Corpus corpus = MockCorpus.CORPUS_1; local
54 mSuggestions.addCorpusResult(corpus.getSuggestions("foo", 50));
55 Set<Corpus> includedCorpora = mSuggestions.getIncludedCorpora();
57 assertTrue(includedCorpora.contains(corpus));
MockCorpusFactory.java 27 public Collection<Corpus> createCorpora(Sources sources) {
28 ArrayList<Corpus> corpora = new ArrayList<Corpus>();
  /packages/apps/QuickSearchBox/src/com/android/quicksearchbox/
SearchableCorpora.java 50 // Maps corpus names to corpora
51 private HashMap<String,Corpus> mCorporaByName;
52 // Maps sources to the corpus that contains them
53 private HashMap<Source,Corpus> mCorporaBySource;
55 private List<Corpus> mEnabledCorpora;
56 // Web corpus
57 private Corpus mWebCorpus;
82 public Collection<Corpus> getAllCorpora() {
87 public Collection<Corpus> getEnabledCorpora() {
92 public Corpus getCorpus(String name)
152 mCorporaByName.put(corpus.getName(), corpus); local
    [all...]
Corpora.java 28 boolean isCorpusEnabled(Corpus corpus);
31 * Checks if a corpus should be enabled by default.
33 boolean isCorpusDefaultEnabled(Corpus corpus);
36 * Gets all corpora, including the web corpus.
40 Collection<Corpus> getAllCorpora();
47 Collection<Corpus> getEnabledCorpora();
50 * Gets a corpus by name.
52 * @return A corpus, or null
    [all...]
EventLogLogger.java 72 public void logStart(int latency, String intentSource, Corpus corpus,
73 List<Corpus> orderedCorpora) {
76 String currentCorpus = getCorpusLogName(corpus);
83 SuggestionCursor suggestionCursor, Collection<Corpus> queriedCorpora) {
90 public void logSearch(Corpus corpus, int startMethod, int numChars) {
91 String corpusName = getCorpusLogName(corpus);
95 public void logVoiceSearch(Corpus corpus) {
    [all...]
DefaultCorpusRanker.java 40 private static class CorpusComparator implements Comparator<Corpus> {
49 public int compare(Corpus corpus1, Corpus corpus2) {
63 * Scores a corpus. Higher score is better.
65 private int getCorpusScore(Corpus corpus) {
66 // Web corpus always comes first
67 if (corpus.isWebCorpus()) {
71 Integer clickScore = mClickScores.get(corpus.getName());
80 public List<Corpus> rankCorpora(Corpora corpora)
    [all...]
Corpus.java 27 * A corpus is a user-visible set of suggestions. A corpus gets suggestions from one
33 public interface Corpus extends SuggestionCursorProvider<CorpusResult> {
36 * Gets the localized, human-readable label for this corpus.
41 * Gets the icon for this corpus.
46 * Gets the icon URI for this corpus.
51 * Gets the description to use for this corpus in system search settings.
56 * Gets the search hint text for this corpus.
75 * Gets the sources that this corpus uses.
SearchWidgetProvider.java 56 Corpus corpus = corpusName == null ? null : getCorpora(context).getCorpus(corpusName); local
57 setupSearchWidget(context, appWidgetManager, appWidgetId, corpus);
61 int appWidgetId, Corpus corpus) {
68 // Corpus indicator
69 bindCorpusIndicator(context, views, widgetAppData, corpus);
74 if (corpus == null || corpus.isWebCorpus()) {
78 hint = corpus.getHint()
    [all...]
ShouldQueryStrategy.java 41 // maps from corpus to the length of the query which returned
44 private final HashMap<Corpus, Integer> mEmptyCorpora
45 = new HashMap<Corpus, Integer>();
50 public boolean shouldQueryCorpus(Corpus corpus, String query) {
52 if (query.length() >= corpus.getQueryThreshold()) {
53 if (!corpus.queryAfterZeroResults() && mEmptyCorpora.containsKey(corpus)) {
54 if (DBG) Log.i(TAG, "Not querying " + corpus + ", returned 0 after "
55 + mEmptyCorpora.get(corpus));
    [all...]
SearchWidgetConfigActivity.java 79 protected void selectCorpus(Corpus corpus) {
80 writeWidgetCorpusPref(mAppWidgetId, corpus);
81 updateWidget(corpus);
89 private void updateWidget(Corpus corpus) {
92 mAppWidgetId, corpus);
103 private void writeWidgetCorpusPref(int appWidgetId, Corpus corpus) {
104 String corpusName = corpus == null ? null : corpus.getName()
129 Corpus corpus = (Corpus) parent.getItemAtPosition(position); local
    [all...]
SingleSourceCorpusResult.java 25 private final Corpus mCorpus;
29 public SingleSourceCorpusResult(Corpus corpus, String userQuery, SuggestionCursor cursor,
32 mCorpus = corpus;
36 public Corpus getCorpus() {
SuggestionsProviderImpl.java 90 protected SuggestionCursor getShortcutsForQuery(String query, List<Corpus> corpora,
99 private List<Corpus> getCorporaToQuery(String query, List<Corpus> orderedCorpora) {
100 ArrayList<Corpus> corporaToQuery = new ArrayList<Corpus>(orderedCorpora.size());
101 for (Corpus corpus : orderedCorpora) {
102 if (shouldQueryCorpus(corpus, query)) {
103 corporaToQuery.add(corpus);
109 protected boolean shouldQueryCorpus(Corpus corpus, String query)
    [all...]
CorpusResult.java 21 * A sequence of suggestions from a single corpus.
26 * Gets the corpus that produced these suggestions.
28 Corpus getCorpus();
CorpusSelectionDialog.java 36 * Corpus selection dialog.
49 private Corpus mCorpus;
58 * Shows the corpus selection dialog.
60 * @param corpus The currently selected corpus.
62 public void show(Corpus corpus) {
63 mCorpus = corpus;
116 // Cancel dialog on any touch down event which is not handled by the corpus grid
178 protected void selectCorpus(Corpus corpus)
187 Corpus corpus = (Corpus) parent.getItemAtPosition(position); local
    [all...]
Logger.java 36 void logStart(int latency, String intentSource, Corpus corpus,
37 List<Corpus> orderedCorpora);
48 Collection<Corpus> queriedCorpora);
56 void logSearch(Corpus corpus, int startMethod, int numChars);
61 void logVoiceSearch(Corpus corpus);
Launcher.java 46 * Gets the corpus to use for any searches. This is the web corpus in "All" mode,
47 * and the selected corpus otherwise.
49 public Corpus getSearchCorpus(Corpora corpora, Corpus selectedCorpus) {
53 Corpus webCorpus = corpora.getWebCorpus();
55 Log.e(TAG, "No web corpus");
61 public boolean shouldShowVoiceSearch(Corpus corpus) {
62 if (corpus != null && !corpus.voiceSearchEnabled())
    [all...]
AbstractCorpusRanker.java 26 * Abstract base class for corpus rankers.
35 private List<Corpus> mRankedCorpora;
45 protected abstract List<Corpus> rankCorpora(Corpora corpora);
47 public List<Corpus> getRankedCorpora() {
SearchableCorpusFactory.java 42 public Collection<Corpus> createCorpora(Sources sources) {
43 ArrayList<Corpus> corpora = new ArrayList<Corpus>();
63 protected void addSpecialCorpora(ArrayList<Corpus> corpora, Sources sources) {
69 * Adds corpora for all sources that are not already used by a corpus.
75 protected void addSingleSourceCorpora(ArrayList<Corpus> corpora, Sources sources) {
78 for (Corpus specialCorpus : corpora) {
90 protected Corpus createWebCorpus(Sources sources) {
97 protected Corpus createAppsCorpus(Sources sources) {
102 protected Corpus createSingleSourceCorpus(Source source)
    [all...]
SearchSettings.java 62 // Preifx of per-corpus enable preference
96 * Gets the preference key of the preference for whether the given corpus
100 public static String getCorpusEnabledPreference(Corpus corpus) {
101 return CORPUS_ENABLED_PREF_PREFIX + corpus.getName();
162 for (Corpus corpus : getCorpora().getAllCorpora()) {
163 Preference pref = createCorpusPreference(corpus);
165 if (DBG) Log.d(TAG, "Adding corpus: " + corpus);
    [all...]
AbstractCorpus.java 21 * Base class for corpus implementations.
23 public abstract class AbstractCorpus implements Corpus {
36 return getName().equals(((Corpus) o).getName());
CorpusRanker.java 34 List<Corpus> getRankedCorpora();
37 * Registers an observer that is called when the corpus list changes.
39 * @param observer gets notified when the corpus list changes.
  /packages/apps/QuickSearchBox/src/com/android/quicksearchbox/ui/
CorporaAdapter.java 19 import com.android.quicksearchbox.Corpus;
45 private List<Corpus> mRankedEnabledCorpora;
81 public Corpus getItem(int position) {
94 * Gets the position of the given corpus.
96 public int getCorpusPosition(Corpus corpus) {
97 if (corpus == null) {
102 if (corpus.equals(getItem(i))) {
106 Log.w(TAG, "Corpus not in adapter: " + corpus);
115 Corpus corpus = getItem(position); local
    [all...]
SuggestionsAdapter.java 19 import com.android.quicksearchbox.Corpus;
44 private Corpus mCorpus = null;
96 public Corpus getCorpus() {
103 public void setCorpus(Corpus corpus) {
104 mCorpus = corpus;
163 protected SuggestionCursor getCorpusCursor(Suggestions suggestions, Corpus corpus) {

Completed in 289 milliseconds

1 2 3