lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dor...@apache.org
Subject svn commit: r547871 - /lucene/java/trunk/src/java/org/apache/lucene/analysis/package.html
Date Sat, 16 Jun 2007 06:48:32 GMT
Author: doronc
Date: Fri Jun 15 23:48:31 2007
New Revision: 547871

URL: http://svn.apache.org/viewvc?view=rev&rev=547871
Log:
fix sample code to be compilable (part of LUCENE-925 - Analysis Package Javadocs)

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/analysis/package.html

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/package.html
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/analysis/package.html?view=diff&rev=547871&r1=547870&r2=547871
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/package.html (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/package.html Fri Jun 15 23:48:31
2007
@@ -215,14 +215,14 @@
    This can be done with something like:
    <PRE>
       public TokenStream tokenStream(final String fieldName, Reader reader) {
-        final TokenStream ts = new SomeAnalyzer(fieldName, reader);
+        final TokenStream ts = someAnalyzer.tokenStream(fieldName, reader);
         TokenStream res = new TokenStream() {
           public Token next() throws IOException {
             int extraIncrement = 0;
             while (true) {
-              Token t = tf.next();
+              Token t = ts.next();
               if (t!=null) {
-                if (stopwords.contains(t.termText())) {
+                if (stopWords.contains(t.termText())) {
                   extraIncrement++; // filter this word
                   continue;
                 } 
@@ -232,9 +232,9 @@
               }
               return t;
             }
-          };
-          return res;
-        }
+          }
+        };
+        return res;
       }
    </PRE>
    Now, with this modified analyzer, the phrase query "blue sky" would find that document.



Mime
View raw message