public abstract class StopwordAnalyzerBase extends Analyzer
Analyzer.GlobalReuseStrategy, Analyzer.PerFieldReuseStrategy, Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents
Modifier and Type | Field and Description |
---|---|
protected CharArraySet |
stopwords
An immutable stopword set
|
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
Modifier | Constructor and Description |
---|---|
protected |
StopwordAnalyzerBase()
Creates a new Analyzer with an empty stopword set
|
protected |
StopwordAnalyzerBase(CharArraySet stopwords)
Creates a new instance initialized with the given stopword set
|
protected |
StopwordAnalyzerBase(Version version)
Deprecated.
|
protected |
StopwordAnalyzerBase(Version version,
CharArraySet stopwords)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
CharArraySet |
getStopwordSet()
Returns the analyzer's stopword set or an empty set if the analyzer has no
stopwords
|
protected static CharArraySet |
loadStopwordSet(boolean ignoreCase,
Class<? extends Analyzer> aClass,
String resource,
String comment)
Creates a CharArraySet from a file resource associated with a class.
|
protected static CharArraySet |
loadStopwordSet(File stopwords)
Creates a CharArraySet from a file.
|
protected static CharArraySet |
loadStopwordSet(File stopwords,
Version matchVersion)
Deprecated.
|
protected static CharArraySet |
loadStopwordSet(Reader stopwords)
Creates a CharArraySet from a file.
|
protected static CharArraySet |
loadStopwordSet(Reader stopwords,
Version matchVersion)
Deprecated.
|
close, createComponents, getOffsetGap, getPositionIncrementGap, getReuseStrategy, getVersion, initReader, setVersion, tokenStream, tokenStream
protected final CharArraySet stopwords
protected StopwordAnalyzerBase(CharArraySet stopwords)
stopwords
- the analyzer's stopword set@Deprecated protected StopwordAnalyzerBase(Version version, CharArraySet stopwords)
StopwordAnalyzerBase(CharArraySet)
protected StopwordAnalyzerBase()
@Deprecated protected StopwordAnalyzerBase(Version version)
StopwordAnalyzerBase()
public CharArraySet getStopwordSet()
protected static CharArraySet loadStopwordSet(boolean ignoreCase, Class<? extends Analyzer> aClass, String resource, String comment) throws IOException
Class.getResourceAsStream(String)
).ignoreCase
- true
if the set should ignore the case of the
stopwords, otherwise false
aClass
- a class that is associated with the given stopwordResourceresource
- name of the resource file associated with the given classcomment
- comment string to ignore in the stopword fileIOException
- if loading the stopwords throws an IOException
protected static CharArraySet loadStopwordSet(File stopwords) throws IOException
stopwords
- the stopwords file to loadIOException
- if loading the stopwords throws an IOException
@Deprecated protected static CharArraySet loadStopwordSet(File stopwords, Version matchVersion) throws IOException
loadStopwordSet(File)
IOException
protected static CharArraySet loadStopwordSet(Reader stopwords) throws IOException
stopwords
- the stopwords reader to loadIOException
- if loading the stopwords throws an IOException
@Deprecated protected static CharArraySet loadStopwordSet(Reader stopwords, Version matchVersion) throws IOException
loadStopwordSet(Reader)
IOException
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.