01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.compass.core.engine.spellcheck;
18:
19: /**
20: * A builder allowing to create suggestions for a given word.
21: *
22: * @author kimchy
23: */
24: public interface SearchEngineSpellCheckSuggestBuilder {
25:
26: /**
27: * Narrows down the spell check suggestions to the given sub indexes.
28: */
29: SearchEngineSpellCheckSuggestBuilder subIndexes(
30: String... subIndexes);
31:
32: /**
33: * Narrows down the spell check suggestions to the given sub aliases.
34: */
35: SearchEngineSpellCheckSuggestBuilder aliases(String... aliases);
36:
37: /**
38: * Narrows down the spell check suggestions to the given types.
39: */
40: SearchEngineSpellCheckSuggestBuilder types(Class... types);
41:
42: /**
43: * Restricts the number of suggestions. Defaults to <code>1</code>.
44: */
45: SearchEngineSpellCheckSuggestBuilder numberOfSuggestions(
46: int numberOfSuggestions);
47:
48: /**
49: * Restricts the suggested words to the words present in this property.
50: */
51: SearchEngineSpellCheckSuggestBuilder restrictToProperty(
52: String restrictToProperty);
53:
54: /**
55: * Return only the suggest words that are more frequent than the searched word.
56: */
57: SearchEngineSpellCheckSuggestBuilder morePopular(boolean morePopular);
58:
59: /**
60: * Sets the accuracy. Defauts to the value of {@link org.compass.core.lucene.LuceneEnvironment.SpellCheck#ACCURACY}
61: * which, in turn, defaults to <code>0.5f</code>.
62: */
63: SearchEngineSpellCheckSuggestBuilder accuracy(float accuracy);
64:
65: /**
66: * Returns the given suggestions for the word.
67: */
68: SearchEngineSpellSuggestions suggest();
69: }
|