mirror of https://github.com/apache/lucene.git
- Fixed indentation.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150125 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e0c4641ac2
commit
0401cf63e4
|
@ -58,32 +58,36 @@ import org.apache.lucene.analysis.*;
|
|||
import java.io.Reader;
|
||||
import java.util.Hashtable;
|
||||
|
||||
/** Filters {@link StandardTokenizer} with {@link StandardFilter}, {@link
|
||||
* LowerCaseFilter} and {@link StopFilter}. */
|
||||
/**
|
||||
* Filters {@link StandardTokenizer} with {@link StandardFilter}, {@link
|
||||
* LowerCaseFilter} and {@link StopFilter}.
|
||||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
public class StandardAnalyzer extends Analyzer {
|
||||
private Hashtable stopTable;
|
||||
private Hashtable stopTable;
|
||||
|
||||
/** An array containing some common English words that are usually not
|
||||
useful for searching. */
|
||||
public static final String[] STOP_WORDS = StopAnalyzer.ENGLISH_STOP_WORDS;
|
||||
/** An array containing some common English words that are usually not
|
||||
useful for searching. */
|
||||
public static final String[] STOP_WORDS = StopAnalyzer.ENGLISH_STOP_WORDS;
|
||||
|
||||
/** Builds an analyzer. */
|
||||
public StandardAnalyzer() {
|
||||
this(STOP_WORDS);
|
||||
}
|
||||
/** Builds an analyzer. */
|
||||
public StandardAnalyzer() {
|
||||
this(STOP_WORDS);
|
||||
}
|
||||
|
||||
/** Builds an analyzer with the given stop words. */
|
||||
public StandardAnalyzer(String[] stopWords) {
|
||||
stopTable = StopFilter.makeStopTable(stopWords);
|
||||
}
|
||||
/** Builds an analyzer with the given stop words. */
|
||||
public StandardAnalyzer(String[] stopWords) {
|
||||
stopTable = StopFilter.makeStopTable(stopWords);
|
||||
}
|
||||
|
||||
/** Constructs a {@link StandardTokenizer} filtered by a {@link
|
||||
StandardFilter}, a {@link LowerCaseFilter} and a {@link StopFilter}. */
|
||||
public TokenStream tokenStream(String fieldName, Reader reader) {
|
||||
TokenStream result = new StandardTokenizer(reader);
|
||||
result = new StandardFilter(result);
|
||||
result = new LowerCaseFilter(result);
|
||||
result = new StopFilter(result, stopTable);
|
||||
return result;
|
||||
}
|
||||
/** Constructs a {@link StandardTokenizer} filtered by a {@link
|
||||
StandardFilter}, a {@link LowerCaseFilter} and a {@link StopFilter}. */
|
||||
public TokenStream tokenStream(String fieldName, Reader reader) {
|
||||
TokenStream result = new StandardTokenizer(reader);
|
||||
result = new StandardFilter(result);
|
||||
result = new LowerCaseFilter(result);
|
||||
result = new StopFilter(result, stopTable);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue