org.apache.lucene.analysis.shingle
Class ShingleAnalyzerWrapper
java.lang.Object
org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.shingle.ShingleAnalyzerWrapper
public class ShingleAnalyzerWrapper
- extends org.apache.lucene.analysis.Analyzer
A ShingleAnalyzerWrapper wraps a ShingleFilter around another Analyzer.
A shingle is another name for a token based n-gram.
| Fields inherited from class org.apache.lucene.analysis.Analyzer |
overridesTokenStreamMethod |
| 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 |
defaultAnalyzer
protected org.apache.lucene.analysis.Analyzer defaultAnalyzer
maxShingleSize
protected int maxShingleSize
outputUnigrams
protected boolean outputUnigrams
ShingleAnalyzerWrapper
public ShingleAnalyzerWrapper(org.apache.lucene.analysis.Analyzer defaultAnalyzer)
ShingleAnalyzerWrapper
public ShingleAnalyzerWrapper(org.apache.lucene.analysis.Analyzer defaultAnalyzer,
int maxShingleSize)
ShingleAnalyzerWrapper
public ShingleAnalyzerWrapper()
- Wraps
StandardAnalyzer.
ShingleAnalyzerWrapper
public ShingleAnalyzerWrapper(int nGramSize)
getMaxShingleSize
public int getMaxShingleSize()
- The max shingle (ngram) size
- Returns:
- The max shingle (ngram) size
setMaxShingleSize
public void setMaxShingleSize(int maxShingleSize)
- Set the maximum size of output shingles
- Parameters:
maxShingleSize - max shingle size
isOutputUnigrams
public boolean isOutputUnigrams()
setOutputUnigrams
public void setOutputUnigrams(boolean outputUnigrams)
- Shall the filter pass the original tokens (the "unigrams") to the output
stream?
- Parameters:
outputUnigrams - Whether or not the filter shall pass the original
tokens to the output stream
tokenStream
public org.apache.lucene.analysis.TokenStream tokenStream(String fieldName,
Reader reader)
- Specified by:
tokenStream in class org.apache.lucene.analysis.Analyzer
reusableTokenStream
public org.apache.lucene.analysis.TokenStream reusableTokenStream(String fieldName,
Reader reader)
throws IOException
- Overrides:
reusableTokenStream in class org.apache.lucene.analysis.Analyzer
- Throws:
IOException
Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.