- Fixed messed up indentation/tabs

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@657281 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Otis Gospodnetic 2008-05-17 01:57:32 +00:00
parent 1d5ba345cc
commit f5df30327e
1 changed files with 41 additions and 38 deletions

View File

@ -24,8 +24,8 @@ import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer;
/** /**
* A ShingleAnalyzerWrapper wraps a ShingleFilter around another analyzer. A shingle is another term for a token based * A ShingleAnalyzerWrapper wraps a ShingleFilter around another analyzer. A
* n-gram. * shingle is another namefor a token based n-gram.
*/ */
public class ShingleAnalyzerWrapper extends Analyzer { public class ShingleAnalyzerWrapper extends Analyzer {
@ -43,6 +43,9 @@ public class ShingleAnalyzerWrapper extends Analyzer {
this.maxShingleSize = maxShingleSize; this.maxShingleSize = maxShingleSize;
} }
/**
* Wraps {@link StandardAnalyzer}.
*/
public ShingleAnalyzerWrapper() { public ShingleAnalyzerWrapper() {
super(); super();
this.defaultAnalyzer = new StandardAnalyzer(); this.defaultAnalyzer = new StandardAnalyzer();
@ -55,6 +58,7 @@ public class ShingleAnalyzerWrapper extends Analyzer {
/** /**
* The max shingle (ngram) size * The max shingle (ngram) size
*
* @return The max shingle (ngram) size * @return The max shingle (ngram) size
*/ */
public int getMaxShingleSize() { public int getMaxShingleSize() {
@ -62,7 +66,7 @@ public class ShingleAnalyzerWrapper extends Analyzer {
} }
/** /**
* Set the maximum size of output shingles (default: 2) * Set the maximum size of output shingles
* *
* @param maxShingleSize max shingle size * @param maxShingleSize max shingle size
*/ */
@ -70,14 +74,13 @@ public class ShingleAnalyzerWrapper extends Analyzer {
this.maxShingleSize = maxShingleSize; this.maxShingleSize = maxShingleSize;
} }
public boolean isOutputUnigrams() { public boolean isOutputUnigrams() {
return outputUnigrams; return outputUnigrams;
} }
/** /**
* Shall the filter pass the original tokens (the "unigrams") to the output * Shall the filter pass the original tokens (the "unigrams") to the output
* stream? (default: true) * stream?
* *
* @param outputUnigrams Whether or not the filter shall pass the original * @param outputUnigrams Whether or not the filter shall pass the original
* tokens to the output stream * tokens to the output stream
@ -87,8 +90,8 @@ public class ShingleAnalyzerWrapper extends Analyzer {
} }
public TokenStream tokenStream(String fieldName, Reader reader) { public TokenStream tokenStream(String fieldName, Reader reader) {
ShingleFilter filter ShingleFilter filter = new ShingleFilter(defaultAnalyzer.tokenStream(
= new ShingleFilter(defaultAnalyzer.tokenStream(fieldName, reader)); fieldName, reader));
filter.setMaxShingleSize(maxShingleSize); filter.setMaxShingleSize(maxShingleSize);
filter.setOutputUnigrams(outputUnigrams); filter.setOutputUnigrams(outputUnigrams);
return filter; return filter;