From f5df30327e1d823281cadc652be8ac820902e9ac Mon Sep 17 00:00:00 2001 From: Otis Gospodnetic Date: Sat, 17 May 2008 01:57:32 +0000 Subject: [PATCH] - Fixed messed up indentation/tabs git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@657281 13f79535-47bb-0310-9956-ffa450edef68 --- .../shingle/ShingleAnalyzerWrapper.java | 79 ++++++++++--------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/contrib/analyzers/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java b/contrib/analyzers/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java index 0868a14163a..4091ccf1ce7 100644 --- a/contrib/analyzers/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java +++ b/contrib/analyzers/src/java/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapper.java @@ -24,37 +24,41 @@ import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.standard.StandardAnalyzer; /** - * A ShingleAnalyzerWrapper wraps a ShingleFilter around another analyzer. A shingle is another term for a token based - * n-gram. + * A ShingleAnalyzerWrapper wraps a ShingleFilter around another analyzer. A + * shingle is another namefor a token based n-gram. */ public class ShingleAnalyzerWrapper extends Analyzer { - protected Analyzer defaultAnalyzer; - protected int maxShingleSize = 2; - protected boolean outputUnigrams = true; + protected Analyzer defaultAnalyzer; + protected int maxShingleSize = 2; + protected boolean outputUnigrams = true; - public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer) { - super(); - this.defaultAnalyzer = defaultAnalyzer; - } + public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer) { + super(); + this.defaultAnalyzer = defaultAnalyzer; + } - public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer, int maxShingleSize) { - this(defaultAnalyzer); - this.maxShingleSize = maxShingleSize; - } + public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer, int maxShingleSize) { + this(defaultAnalyzer); + this.maxShingleSize = maxShingleSize; + } - public ShingleAnalyzerWrapper() { - super(); - this.defaultAnalyzer = new StandardAnalyzer(); - } + /** + * Wraps {@link StandardAnalyzer}. + */ + public ShingleAnalyzerWrapper() { + super(); + this.defaultAnalyzer = new StandardAnalyzer(); + } - public ShingleAnalyzerWrapper(int nGramSize) { - this(); - this.maxShingleSize = nGramSize; - } + public ShingleAnalyzerWrapper(int nGramSize) { + this(); + this.maxShingleSize = nGramSize; + } /** * The max shingle (ngram) size + * * @return The max shingle (ngram) size */ public int getMaxShingleSize() { @@ -62,14 +66,13 @@ 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 */ - public void setMaxShingleSize(int maxShingleSize) { - this.maxShingleSize = maxShingleSize; - } - + public void setMaxShingleSize(int maxShingleSize) { + this.maxShingleSize = maxShingleSize; + } public boolean isOutputUnigrams() { return outputUnigrams; @@ -77,20 +80,20 @@ public class ShingleAnalyzerWrapper extends Analyzer { /** * 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 - * tokens to the output stream + * tokens to the output stream */ - public void setOutputUnigrams(boolean outputUnigrams) { - this.outputUnigrams = outputUnigrams; - } + public void setOutputUnigrams(boolean outputUnigrams) { + this.outputUnigrams = outputUnigrams; + } - public TokenStream tokenStream(String fieldName, Reader reader) { - ShingleFilter filter - = new ShingleFilter(defaultAnalyzer.tokenStream(fieldName, reader)); - filter.setMaxShingleSize(maxShingleSize); - filter.setOutputUnigrams(outputUnigrams); + public TokenStream tokenStream(String fieldName, Reader reader) { + ShingleFilter filter = new ShingleFilter(defaultAnalyzer.tokenStream( + fieldName, reader)); + filter.setMaxShingleSize(maxShingleSize); + filter.setOutputUnigrams(outputUnigrams); return filter; } }