|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 namefor a token based n-gram.
Field Summary | |
---|---|
protected Analyzer |
defaultAnalyzer
|
protected int |
maxShingleSize
|
protected boolean |
outputUnigrams
|
Constructor Summary | |
---|---|
ShingleAnalyzerWrapper()
Wraps StandardAnalyzer . |
|
ShingleAnalyzerWrapper(Analyzer defaultAnalyzer)
|
|
ShingleAnalyzerWrapper(Analyzer defaultAnalyzer,
int maxShingleSize)
|
|
ShingleAnalyzerWrapper(int nGramSize)
|
Method Summary | |
---|---|
int |
getMaxShingleSize()
The max shingle (ngram) size |
boolean |
isOutputUnigrams()
|
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? |
TokenStream |
tokenStream(String fieldName,
Reader reader)
Creates a TokenStream which tokenizes all the text in the provided Reader. |
Methods inherited from class org.apache.lucene.analysis.Analyzer |
---|
getPositionIncrementGap, getPreviousTokenStream, reusableTokenStream, setPreviousTokenStream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Analyzer defaultAnalyzer
protected int maxShingleSize
protected boolean outputUnigrams
Constructor Detail |
---|
public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer)
public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer, int maxShingleSize)
public ShingleAnalyzerWrapper()
StandardAnalyzer
.
public ShingleAnalyzerWrapper(int nGramSize)
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 TokenStream tokenStream(String fieldName, Reader reader)
Analyzer
tokenStream
in class Analyzer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |