|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.analysis.Analyzer org.apache.lucene.analysis.shingle.ShingleAnalyzerWrapper
public class ShingleAnalyzerWrapper
A ShingleAnalyzerWrapper wraps a ShingleFilter
around another Analyzer
.
A shingle is another name for a token based n-gram.
Field Summary | |
---|---|
protected org.apache.lucene.analysis.Analyzer |
defaultAnalyzer
|
protected int |
maxShingleSize
|
protected boolean |
outputUnigrams
|
Fields inherited from class org.apache.lucene.analysis.Analyzer |
---|
overridesTokenStreamMethod |
Constructor Summary | |
---|---|
ShingleAnalyzerWrapper(org.apache.lucene.analysis.Analyzer defaultAnalyzer)
|
|
ShingleAnalyzerWrapper(org.apache.lucene.analysis.Analyzer defaultAnalyzer,
int maxShingleSize)
|
|
ShingleAnalyzerWrapper(org.apache.lucene.util.Version matchVersion)
Wraps StandardAnalyzer . |
|
ShingleAnalyzerWrapper(org.apache.lucene.util.Version matchVersion,
int nGramSize)
Wraps StandardAnalyzer . |
Method Summary | |
---|---|
int |
getMaxShingleSize()
The max shingle (ngram) size |
boolean |
isOutputUnigrams()
|
org.apache.lucene.analysis.TokenStream |
reusableTokenStream(String fieldName,
Reader reader)
|
void |
setMaxShingleSize(int maxShingleSize)
Set the maximum size of output shingles |
void |
setOutputUnigrams(boolean outputUnigrams)
Shall the filter pass the original tokens (the "unigrams") to the output stream? |
org.apache.lucene.analysis.TokenStream |
tokenStream(String fieldName,
Reader reader)
|
Methods inherited from class org.apache.lucene.analysis.Analyzer |
---|
close, getOffsetGap, getPositionIncrementGap, getPreviousTokenStream, setOverridesTokenStreamMethod, setPreviousTokenStream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.lucene.analysis.Analyzer defaultAnalyzer
protected int maxShingleSize
protected boolean outputUnigrams
Constructor Detail |
---|
public ShingleAnalyzerWrapper(org.apache.lucene.analysis.Analyzer defaultAnalyzer)
public ShingleAnalyzerWrapper(org.apache.lucene.analysis.Analyzer defaultAnalyzer, int maxShingleSize)
public ShingleAnalyzerWrapper(org.apache.lucene.util.Version matchVersion)
StandardAnalyzer
.
public ShingleAnalyzerWrapper(org.apache.lucene.util.Version matchVersion, int nGramSize)
StandardAnalyzer
.
Method Detail |
---|
public int getMaxShingleSize()
public void setMaxShingleSize(int maxShingleSize)
maxShingleSize
- max shingle sizepublic boolean isOutputUnigrams()
public void setOutputUnigrams(boolean outputUnigrams)
outputUnigrams
- Whether or not the filter shall pass the original
tokens to the output streampublic org.apache.lucene.analysis.TokenStream tokenStream(String fieldName, Reader reader)
tokenStream
in class org.apache.lucene.analysis.Analyzer
public org.apache.lucene.analysis.TokenStream reusableTokenStream(String fieldName, Reader reader) throws IOException
reusableTokenStream
in class org.apache.lucene.analysis.Analyzer
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |