Closeable
, AutoCloseable
ArabicAnalyzer
, ArmenianAnalyzer
, BasqueAnalyzer
, BrazilianAnalyzer
, BulgarianAnalyzer
, CatalanAnalyzer
, CJKAnalyzer
, ClassicAnalyzer
, DanishAnalyzer
, EnglishAnalyzer
, FinnishAnalyzer
, FrenchAnalyzer
, GalicianAnalyzer
, GermanAnalyzer
, GreekAnalyzer
, HindiAnalyzer
, HungarianAnalyzer
, IndonesianAnalyzer
, IrishAnalyzer
, ItalianAnalyzer
, JapaneseAnalyzer
, LatvianAnalyzer
, NorwegianAnalyzer
, PersianAnalyzer
, PolishAnalyzer
, PortugueseAnalyzer
, RomanianAnalyzer
, RussianAnalyzer
, SpanishAnalyzer
, StandardAnalyzer
, StopAnalyzer
, SwedishAnalyzer
, ThaiAnalyzer
, TurkishAnalyzer
, UAX29URLEmailAnalyzer
public abstract class StopwordAnalyzerBase extends ReusableAnalyzerBase
ReusableAnalyzerBase.TokenStreamComponents
Modifier and Type | Field | Description |
---|---|---|
protected Version |
matchVersion |
|
protected CharArraySet |
stopwords |
An immutable stopword set
|
Modifier | Constructor | Description |
---|---|---|
protected |
StopwordAnalyzerBase(Version version) |
Creates a new Analyzer with an empty stopword set
|
protected |
StopwordAnalyzerBase(Version version,
Set<?> stopwords) |
Creates a new instance initialized with the given stopword set
|
Modifier and Type | Method | Description |
---|---|---|
Set<?> |
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 ReusableAnalyzerBase> aClass,
String resource,
String comment) |
Creates a CharArraySet from a file resource associated with a class.
|
protected static CharArraySet |
loadStopwordSet(File stopwords,
Version matchVersion) |
Creates a CharArraySet from a file.
|
protected static CharArraySet |
loadStopwordSet(Reader stopwords,
Version matchVersion) |
Creates a CharArraySet from a file.
|
close, getOffsetGap, getPositionIncrementGap, getPreviousTokenStream, setPreviousTokenStream
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createComponents, initReader, reusableTokenStream, tokenStream
protected final CharArraySet stopwords
protected final Version matchVersion
protected StopwordAnalyzerBase(Version version, Set<?> stopwords)
version
- the Lucene version for cross version compatibilitystopwords
- the analyzer's stopword setprotected StopwordAnalyzerBase(Version version)
version
- the Lucene version for cross version compatibilitypublic Set<?> getStopwordSet()
protected static CharArraySet loadStopwordSet(boolean ignoreCase, Class<? extends ReusableAnalyzerBase> 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, Version matchVersion) throws IOException
stopwords
- the stopwords file to loadmatchVersion
- the Lucene version for cross version compatibilityIOException
- if loading the stopwords throws an IOException
protected static CharArraySet loadStopwordSet(Reader stopwords, Version matchVersion) throws IOException
stopwords
- the stopwords reader to loadmatchVersion
- the Lucene version for cross version compatibilityIOException
- if loading the stopwords throws an IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.