lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/analysis PorterStemFilter.java
Date Thu, 21 Feb 2002 21:41:53 GMT
otis        02/02/21 13:41:53

  Modified:    src/java/org/apache/lucene/analysis PorterStemFilter.java
  Log:
  - Made the code in the javadoc readable.
  - Removed unnecessary import statement.
  - Re-indented the whole class.
  
  Revision  Changes    Path
  1.2       +26 -26    jakarta-lucene/src/java/org/apache/lucene/analysis/PorterStemFilter.java
  
  Index: PorterStemFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/PorterStemFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PorterStemFilter.java	18 Sep 2001 16:29:50 -0000	1.1
  +++ PorterStemFilter.java	21 Feb 2002 21:41:53 -0000	1.2
  @@ -55,44 +55,44 @@
    */
   
   import java.io.IOException;
  -import java.util.Hashtable;
   
  -/** Transforms the token stream as per the Porter stemming algorithm. 
  -    Note: the input to the stemming filter must already be in lower case, 
  +/** Transforms the token stream as per the Porter stemming algorithm.
  +    Note: the input to the stemming filter must already be in lower case,
       so you will need to use LowerCaseFilter or LowerCaseTokenizer farther
  -    down the Tokenizer chain in order for this to work properly!  
  -
  -    To use this filter with other analyzers, you'll want to write an 
  -    Analyzer class that sets up the TokenStream chain as you want it.  
  +    down the Tokenizer chain in order for this to work properly!
  +    <P>
  +    To use this filter with other analyzers, you'll want to write an
  +    Analyzer class that sets up the TokenStream chain as you want it.
       To use this with LowerCaseTokenizer, for example, you'd write an
       analyzer like this:
  -
  +    <P>
  +    <PRE>
       class MyAnalyzer extends Analyzer {
         public final TokenStream tokenStream(String fieldName, Reader reader) {
           return new PorterStemFilter(new LowerCaseTokenizer(reader));
         }
  -    } 
  -
  +    }
  +    </PRE>
   */
   
   public final class PorterStemFilter extends TokenFilter {
  -  private PorterStemmer stemmer;
  +    private PorterStemmer stemmer;
   
  -  public PorterStemFilter(TokenStream in) {
  -    stemmer = new PorterStemmer();
  -    input = in;
  -  }
  +    public PorterStemFilter(TokenStream in) {
  +	stemmer = new PorterStemmer();
  +	input = in;
  +    }
   
  -  /** Returns the next input Token, after being stemmed */
  -  public final Token next() throws IOException {
  -    Token token = input.next();
  -    if (token == null)
  -      return null;
  -    else {
  -      String s = stemmer.stem(token.termText);
  -      if (s != token.termText) // Yes, I mean object reference comparison here
  -        token.termText = s;
  -      return token;
  +    /** Returns the next input Token, after being stemmed */
  +    public final Token next() throws IOException {
  +	Token token = input.next();
  +	if (token == null)
  +	    return null;
  +	else {
  +	    String s = stemmer.stem(token.termText);
  +	    if (s != token.termText) // Yes, I mean object reference comparison here
  +		token.termText = s;
  +	    return token;
  +	}
       }
  -  }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message