lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject cvs commit: jakarta-lucene/src/test/org/apache/lucene/queryParser TestQueryParser.java
Date Mon, 09 Dec 2002 19:02:21 GMT
cutting     2002/12/09 11:02:21

  Modified:    src/java/org/apache/lucene/analysis CharTokenizer.java
                        LowerCaseFilter.java PorterStemFilter.java
                        SimpleAnalyzer.java StopAnalyzer.java
                        StopFilter.java TokenFilter.java Tokenizer.java
                        WhitespaceAnalyzer.java
               src/java/org/apache/lucene/analysis/de GermanStemFilter.java
               src/java/org/apache/lucene/analysis/ru RussianAnalyzer.java
                        RussianLowerCaseFilter.java RussianStemFilter.java
               src/java/org/apache/lucene/analysis/standard
                        StandardAnalyzer.java StandardFilter.java
               src/test/org/apache/lucene/queryParser TestQueryParser.java
  Log:
  Minor cleanups: added constructors for TokenStream & TokenFilter, made some methods
non-final.
  
  Revision  Changes    Path
  1.3       +1 -1      jakarta-lucene/src/java/org/apache/lucene/analysis/CharTokenizer.java
  
  Index: CharTokenizer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/CharTokenizer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CharTokenizer.java	7 Nov 2002 05:55:39 -0000	1.2
  +++ CharTokenizer.java	9 Dec 2002 19:02:20 -0000	1.3
  @@ -59,7 +59,7 @@
   /** An abstract base class for simple, character-oriented tokenizers.*/
   public abstract class CharTokenizer extends Tokenizer {
     public CharTokenizer(Reader input) {
  -    this.input = input;
  +    super(input);
     }
   
     private int offset = 0, bufferIndex=0, dataLen=0;
  
  
  
  1.2       +1 -1      jakarta-lucene/src/java/org/apache/lucene/analysis/LowerCaseFilter.java
  
  Index: LowerCaseFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/LowerCaseFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LowerCaseFilter.java	18 Sep 2001 16:29:50 -0000	1.1
  +++ LowerCaseFilter.java	9 Dec 2002 19:02:20 -0000	1.2
  @@ -58,7 +58,7 @@
   
   public final class LowerCaseFilter extends TokenFilter {
     public LowerCaseFilter(TokenStream in) {
  -    input = in;
  +    super(in);
     }
   
     public final Token next() throws java.io.IOException {
  
  
  
  1.3       +2 -2      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PorterStemFilter.java	21 Feb 2002 21:41:53 -0000	1.2
  +++ PorterStemFilter.java	9 Dec 2002 19:02:20 -0000	1.3
  @@ -79,8 +79,8 @@
       private PorterStemmer stemmer;
   
       public PorterStemFilter(TokenStream in) {
  -	stemmer = new PorterStemmer();
  -	input = in;
  +      super(in);
  +      stemmer = new PorterStemmer();
       }
   
       /** Returns the next input Token, after being stemmed */
  
  
  
  1.2       +1 -1      jakarta-lucene/src/java/org/apache/lucene/analysis/SimpleAnalyzer.java
  
  Index: SimpleAnalyzer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/SimpleAnalyzer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleAnalyzer.java	18 Sep 2001 16:29:50 -0000	1.1
  +++ SimpleAnalyzer.java	9 Dec 2002 19:02:20 -0000	1.2
  @@ -59,7 +59,7 @@
   /** An Analyzer that filters LetterTokenizer with LowerCaseFilter. */
   
   public final class SimpleAnalyzer extends Analyzer {
  -  public final TokenStream tokenStream(String fieldName, Reader reader) {
  +  public TokenStream tokenStream(String fieldName, Reader reader) {
       return new LowerCaseTokenizer(reader);
     }
   }
  
  
  
  1.2       +1 -1      jakarta-lucene/src/java/org/apache/lucene/analysis/StopAnalyzer.java
  
  Index: StopAnalyzer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/StopAnalyzer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StopAnalyzer.java	18 Sep 2001 16:29:50 -0000	1.1
  +++ StopAnalyzer.java	9 Dec 2002 19:02:20 -0000	1.2
  @@ -83,7 +83,7 @@
     }
   
     /** Filters LowerCaseTokenizer with StopFilter. */
  -  public final TokenStream tokenStream(String fieldName, Reader reader) {
  +  public TokenStream tokenStream(String fieldName, Reader reader) {
       return new StopFilter(new LowerCaseTokenizer(reader), stopTable);
     }
   }
  
  
  
  1.3       +2 -2      jakarta-lucene/src/java/org/apache/lucene/analysis/StopFilter.java
  
  Index: StopFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/StopFilter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StopFilter.java	7 Nov 2002 05:55:39 -0000	1.2
  +++ StopFilter.java	9 Dec 2002 19:02:20 -0000	1.3
  @@ -66,14 +66,14 @@
     /** Constructs a filter which removes words from the input
       TokenStream that are named in the array of words. */
     public StopFilter(TokenStream in, String[] stopWords) {
  -    input = in;
  +    super(in);
       table = makeStopTable(stopWords);
     }
   
     /** Constructs a filter which removes words from the input
       TokenStream that are named in the Hashtable. */
     public StopFilter(TokenStream in, Hashtable stopTable) {
  -    input = in;
  +    super(in);
       table = stopTable;
     }
     
  
  
  
  1.3       +9 -0      jakarta-lucene/src/java/org/apache/lucene/analysis/TokenFilter.java
  
  Index: TokenFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/TokenFilter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TokenFilter.java	7 Nov 2002 05:55:39 -0000	1.2
  +++ TokenFilter.java	9 Dec 2002 19:02:20 -0000	1.3
  @@ -65,6 +65,15 @@
     /** The source of tokens for this filter. */
     protected TokenStream input;
   
  +  /** Call TokenFilter(TokenStream) instead.
  +   * @deprecated */
  +  protected TokenFilter() {}
  +
  +  /** Construct a token stream filtering the given input. */
  +  protected TokenFilter(TokenStream input) {
  +    this.input = input;
  +  }
  +
     /** Close the input TokenStream. */
     public void close() throws IOException {
       input.close();
  
  
  
  1.3       +8 -0      jakarta-lucene/src/java/org/apache/lucene/analysis/Tokenizer.java
  
  Index: Tokenizer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/Tokenizer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Tokenizer.java	7 Nov 2002 05:55:39 -0000	1.2
  +++ Tokenizer.java	9 Dec 2002 19:02:20 -0000	1.3
  @@ -66,6 +66,14 @@
     /** The text source for this Tokenizer. */
     protected Reader input;
   
  +  /** Construct a tokenizer with null input. */
  +  protected Tokenizer() {}
  +
  +  /** Construct a token stream processing the given input. */
  +  protected Tokenizer(Reader input) {
  +    this.input = input;
  +  }
  +
     /** By default, closes the input Reader. */
     public void close() throws IOException {
       input.close();
  
  
  
  1.2       +1 -1      jakarta-lucene/src/java/org/apache/lucene/analysis/WhitespaceAnalyzer.java
  
  Index: WhitespaceAnalyzer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/WhitespaceAnalyzer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WhitespaceAnalyzer.java	24 Jan 2002 19:02:52 -0000	1.1
  +++ WhitespaceAnalyzer.java	9 Dec 2002 19:02:20 -0000	1.2
  @@ -59,7 +59,7 @@
   /** An Analyzer that uses WhitespaceTokenizer. */
   
   public final class WhitespaceAnalyzer extends Analyzer {
  -  public final TokenStream tokenStream(String fieldName, Reader reader) {
  +  public TokenStream tokenStream(String fieldName, Reader reader) {
       return new WhitespaceTokenizer(reader);
     }
   }
  
  
  
  1.5       +2 -2      jakarta-lucene/src/java/org/apache/lucene/analysis/de/GermanStemFilter.java
  
  Index: GermanStemFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/de/GermanStemFilter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GermanStemFilter.java	18 Aug 2002 17:33:16 -0000	1.4
  +++ GermanStemFilter.java	9 Dec 2002 19:02:21 -0000	1.5
  @@ -79,8 +79,8 @@
       
       public GermanStemFilter( TokenStream in )
       {
  +        super(in);
   	stemmer = new GermanStemmer();
  -	input = in;
       }
       
       /**
  
  
  
  1.2       +1 -1      jakarta-lucene/src/java/org/apache/lucene/analysis/ru/RussianAnalyzer.java
  
  Index: RussianAnalyzer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/ru/RussianAnalyzer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RussianAnalyzer.java	16 Sep 2002 02:51:58 -0000	1.1
  +++ RussianAnalyzer.java	9 Dec 2002 19:02:21 -0000	1.2
  @@ -280,7 +280,7 @@
        * @return  A TokenStream build from a RussianLetterTokenizer filtered with
        *                  RussianLowerCaseFilter, StopFilter, and RussianStemFilter
        */
  -    public final TokenStream tokenStream(String fieldName, Reader reader)
  +    public TokenStream tokenStream(String fieldName, Reader reader)
       {
           TokenStream result = new RussianLetterTokenizer(reader, charset);
           result = new RussianLowerCaseFilter(result, charset);
  
  
  
  1.2       +2 -2      jakarta-lucene/src/java/org/apache/lucene/analysis/ru/RussianLowerCaseFilter.java
  
  Index: RussianLowerCaseFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/ru/RussianLowerCaseFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RussianLowerCaseFilter.java	16 Sep 2002 02:51:58 -0000	1.1
  +++ RussianLowerCaseFilter.java	9 Dec 2002 19:02:21 -0000	1.2
  @@ -69,7 +69,7 @@
   
       public RussianLowerCaseFilter(TokenStream in, char[] charset)
       {
  -        input = in;
  +        super(in);
           this.charset = charset;
       }
   
  
  
  
  1.2       +2 -2      jakarta-lucene/src/java/org/apache/lucene/analysis/ru/RussianStemFilter.java
  
  Index: RussianStemFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/ru/RussianStemFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RussianStemFilter.java	16 Sep 2002 02:51:58 -0000	1.1
  +++ RussianStemFilter.java	9 Dec 2002 19:02:21 -0000	1.2
  @@ -77,8 +77,8 @@
   
       public RussianStemFilter(TokenStream in, char[] charset)
       {
  +        super(in);
           stemmer = new RussianStemmer(charset);
  -        input = in;
       }
   
       /**
  
  
  
  1.4       +1 -1      jakarta-lucene/src/java/org/apache/lucene/analysis/standard/StandardAnalyzer.java
  
  Index: StandardAnalyzer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/standard/StandardAnalyzer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardAnalyzer.java	22 Feb 2002 01:15:51 -0000	1.3
  +++ StandardAnalyzer.java	9 Dec 2002 19:02:21 -0000	1.4
  @@ -85,7 +85,7 @@
   
       /** Constructs a {@link StandardTokenizer} filtered by a {@link
   	StandardFilter}, a {@link LowerCaseFilter} and a {@link StopFilter}. */
  -    public final TokenStream tokenStream(String fieldName, Reader reader) {
  +    public TokenStream tokenStream(String fieldName, Reader reader) {
   	TokenStream result = new StandardTokenizer(reader);
   	result = new StandardFilter(result);
   	result = new LowerCaseFilter(result);
  
  
  
  1.2       +1 -1      jakarta-lucene/src/java/org/apache/lucene/analysis/standard/StandardFilter.java
  
  Index: StandardFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/standard/StandardFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StandardFilter.java	18 Sep 2001 16:29:51 -0000	1.1
  +++ StandardFilter.java	9 Dec 2002 19:02:21 -0000	1.2
  @@ -64,7 +64,7 @@
   
     /** Construct filtering <i>in</i>. */
     public StandardFilter(TokenStream in) {
  -    input = in;
  +    super(in);
     }
   
     private static final String APOSTROPHE_TYPE = tokenImage[APOSTROPHE];
  
  
  
  1.16      +1 -1      jakarta-lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java
  
  Index: TestQueryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- TestQueryParser.java	18 Jul 2002 14:17:41 -0000	1.15
  +++ TestQueryParser.java	9 Dec 2002 19:02:21 -0000	1.16
  @@ -82,7 +82,7 @@
   	 * token 'phrase' into 'phrase1 phrase2'
   	 */
   	public QPTestFilter(TokenStream in) {
  -	    input = in;
  +            super(in);
   	}
   
   	boolean inPhrase = false;
  
  
  

--
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