HomeSort by relevance Sort by last modified time
    Searched refs:Corpus (Results 1 - 25 of 47) sorted by null

1 2

  /packages/apps/QuickSearchBox/tests/src/com/android/quicksearchbox/
MockCorpora.java 39 private HashMap<String,Corpus> mCorporaByName = new HashMap<String,Corpus>();
40 private HashSet<Corpus> mDefaultCorpora = new HashSet<Corpus>();
42 private Corpus mWebCorpus;
44 public void addCorpus(Corpus corpus) {
45 Corpus oldCorpus = mCorporaByName.put(corpus.getName(), corpus);
    [all...]
MockLogger.java 30 public void logStart(int onCreateLatency, int latency, String intentSource, Corpus corpus,
31 List<Corpus> orderedCorpora) {
35 SuggestionCursor suggestionCursor, Collection<Corpus> queriedCorpora,
39 public void logSearch(Corpus corpus, int startMethod, int numChars) {
42 public void logVoiceSearch(Corpus corpus) {
RankAwarePromoterTest.java 35 private final List<Corpus> mCorpora = createMockCorpora(5, MAX_PROMOTED_CORPORA);
36 private final Corpus mShortcuts = createMockShortcutsCorpus();
82 // The promoted results. There's just one result from corpus
83 // 2 because only 2 test suggestions per corpus are generated
85 // for corpus 2 earlier than the rest.
125 for (Corpus corpus : mCorpora) {
126 results.add(corpus.getSuggestions(query, 10, false));
131 private static List<Corpus> createMockCorpora(int count, int defaultCount) {
132 ArrayList<Corpus> corpora = new ArrayList<Corpus>()
    [all...]
MockCorpus.java 28 * Mock implementation of {@link Corpus}.
31 public class MockCorpus implements Corpus {
33 public static final Corpus CORPUS_1 = new MockCorpus(MockSource.SOURCE_1);
35 public static final Corpus CORPUS_2 = new MockCorpus(MockSource.SOURCE_2);
37 public static final Corpus WEB_CORPUS = new MockCorpus(MockSource.WEB_SOURCE);
123 public Corpus getCorpus() {
SuggestionsTest.java 38 private List<Corpus> mExpectedCorpora;
59 List<Corpus> expectedCorpora = mSuggestions.getExpectedCorpora();
78 Corpus corpus = MockCorpus.CORPUS_1; local
80 Collections.singletonList(corpus.getSuggestions("foo", 50, true)));
81 Set<Corpus> includedCorpora = mSuggestions.getIncludedCorpora();
83 assertTrue(includedCorpora.contains(corpus));
87 Corpus corpus = MockCorpus.CORPUS_1; local
91 Collections.singletonList(corpus.getSuggestions("foo", 50, true)))
    [all...]
DefaultCorpusRankerTest.java 76 private List<Corpus> getRankedCorpora() {
77 ConsumerTrap<List<Corpus>> consumer = new ConsumerTrap<List<Corpus>>();
SearchableCorporaTest.java 53 public boolean isCorpusEnabled(Corpus corpus) {
54 return !CORPUS_DISABLED.equals(corpus);
98 public Collection<Corpus> createCorpora(Sources sources) {
99 return Arrays.<Corpus>asList(CORPUS_1, CORPUS_DISABLED, CORPUS_NOT_IN_ALL, CORPUS_WEB);
  /packages/apps/QuickSearchBox/src/com/android/quicksearchbox/
Corpora.java 30 * Gets all corpora, including the web corpus.
34 Collection<Corpus> getAllCorpora();
41 List<Corpus> getEnabledCorpora();
48 List<Corpus> getCorporaInAll();
51 * Gets a corpus by name.
53 * @return A corpus, or null.
55 Corpus getCorpus(String name);
58 * Gets the web search corpus.
60 * @return The web search corpus, or {@code null} if there is no web search corpus
    [all...]
CorpusResult.java 21 * A sequence of suggestions from a single corpus.
26 * Gets the corpus that produced these suggestions.
28 Corpus getCorpus();
Logger.java 40 void logStart(int onCreateLatency, int latency, String intentSource, Corpus corpus,
41 List<Corpus> orderedCorpora);
54 Collection<Corpus> queriedCorpora, int clickType);
62 void logSearch(Corpus corpus, int startMethod, int numChars);
67 void logVoiceSearch(Corpus corpus);
SingleSourceCorpusResult.java 25 private final Corpus mCorpus;
29 public SingleSourceCorpusResult(Corpus corpus, String userQuery, SuggestionCursor cursor,
32 mCorpus = corpus;
36 public Corpus getCorpus() {
CorpusFactory.java 26 Collection<Corpus> createCorpora(Sources sources);
SearchableCorpora.java 47 // Maps corpus names to corpora
48 private HashMap<String,Corpus> mCorporaByName;
49 // Maps sources to the corpus that contains them
50 private HashMap<Source,Corpus> mCorporaBySource;
52 private List<Corpus> mEnabledCorpora;
53 // Web corpus
54 private Corpus mWebCorpus;
72 public Collection<Corpus> getAllCorpora() {
76 public List<Corpus> getEnabledCorpora() {
80 public List<Corpus> getCorporaInAll()
121 mCorporaByName.put(corpus.getName(), corpus); local
    [all...]
CorpusRanker.java 36 void getCorporaInAll(Consumer<List<Corpus>> consumer);
SingleCorpusResultsPromoter.java 19 * Promotes non-web-search shortcuts and suggestions from a single corpus.
23 public SingleCorpusResultsPromoter(Corpus corpus, int maxShortcuts) {
24 super(corpus, maxShortcuts);
SuggestionsProvider.java 34 Suggestions getSuggestions(String query, List<Corpus> corporaToQuery);
DefaultCorpusRanker.java 33 * A corpus ranker that uses corpus scores from the shortcut repository to rank
49 * Creates a new default corpus ranker.
52 * @param shortcuts Shortcut repository for getting corpus scores.
61 public void getCorporaInAll(Consumer<List<Corpus>> consumer) {
76 private class RankedCorporaCache extends CachedLater<List<Corpus>> {
82 Collection<Corpus> enabledCorpora = mCorpora.getCorporaInAll();
84 ArrayList<Corpus> ordered = new ArrayList<Corpus>(enabledCorpora);
98 private static class CorpusComparator implements Comparator<Corpus> {
    [all...]
ShouldQueryStrategy.java 44 // maps from corpus to the length of the query which returned
47 private final HashMap<Corpus, Integer> mEmptyCorpora
48 = new HashMap<Corpus, Integer>();
57 public boolean shouldQueryCorpus(Corpus corpus, String query) {
60 && !corpus.isWebCorpus() // always query web, to warm up connection
64 if (query.length() >= corpus.getQueryThreshold()) {
65 if (!corpus.queryAfterZeroResults() && mEmptyCorpora.containsKey(corpus)) {
66 if (DBG) Log.i(TAG, "Not querying " + corpus + ", returned 0 after
    [all...]
AbstractCorpus.java 23 * Base class for corpus implementations.
25 public abstract class AbstractCorpus implements Corpus {
56 return getName().equals(((Corpus) o).getName());
SearchableCorpusFactory.java 52 public Collection<Corpus> createCorpora(Sources sources) {
53 ArrayList<Corpus> corpora = new ArrayList<Corpus>();
77 protected void addSpecialCorpora(ArrayList<Corpus> corpora, Sources sources) {
83 * Adds corpora for all sources that are not already used by a corpus.
89 protected void addSingleSourceCorpora(ArrayList<Corpus> corpora, Sources sources) {
92 for (Corpus specialCorpus : corpora) {
104 private void addCorpus(ArrayList<Corpus> corpora, Corpus corpus) {
    [all...]
EventLogLogger.java 60 public void logStart(int onCreateLatency, int latency, String intentSource, Corpus corpus,
61 List<Corpus> orderedCorpora) {
64 String currentCorpus = getCorpusLogName(corpus);
71 Collection<Corpus> queriedCorpora, int clickType) {
79 public void logSearch(Corpus corpus, int startMethod, int numChars) {
80 String corpusName = getCorpusLogName(corpus);
84 public void logVoiceSearch(Corpus corpus) {
    [all...]
SearchSettings.java 35 public boolean isCorpusEnabled(Corpus corpus);
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.
61 * @return The minimum query length for which this corpus should be queried.
76 * Gets the sources that this corpus uses
    [all...]
  /packages/apps/QuickSearchBox/src/com/android/quicksearchbox/ui/
CorporaAdapter.java 20 import com.android.quicksearchbox.Corpus;
53 private List<Corpus> mSortedCorpora;
65 public void setCurrentCorpus(Corpus corpus) {
66 mCurrentCorpusName = corpus == null ? null : corpus.getName();
71 List<Corpus> enabledCorpora = mCorpora.getEnabledCorpora();
72 ArrayList<Corpus> sorted = new ArrayList<Corpus>(enabledCorpora.size());
73 for (Corpus corpus : enabledCorpora)
137 Corpus corpus = getItem(position); local
    [all...]
SearchActivityViewSinglePane.java 19 import com.android.quicksearchbox.Corpus;
75 protected void setCorpus(Corpus corpus) {
76 super.setCorpus(corpus);
80 if (corpus == null) {
83 sourceIcon = corpus.getCorpusIcon();
91 Corpus corpus = getCorpus(); local
92 if (corpus == null) {
95 return getQsbApplication().createSingleCorpusPromoter(corpus);
105 Corpus corpus = getCorpus(); local
    [all...]

Completed in 117 milliseconds

1 2