lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mário André <mario...@infonet.com.br>
Subject Question about TokenStream lucene 3.0
Date Wed, 30 Dec 2009 17:18:15 GMT
Hi,
I have the method below:

    public final TokenStream tokenStream(String fieldName, Reader reader)
    {
        TokenStream result = new LowerCaseTokenizer(reader);
        result = new StopFilter(true, result, stopWords, true);
        result = new PorterStemFilter(result);
        return result;        
    }

Using PorterStemFilter and removing the stopwords, but how can I use
TokenStream in release 3.0 (print the result this method).

I tried to use:

    public static void main(String[] args) throws IOException,
ParseException 
    {
      StringReader sr = new StringReader("The man is very good. He talked
about many thigs");
      PorterStemAnalyzer ps = new PorterStemAnalyzer();
      TokenStream tokenstream = ps.tokenStream(null, sr);

      //Tokenizer token = (Tokenizer) ps.tokenStream(null, sr);
      while(tokenstream.incrementToken())
      {
          ????????
      }
      
    }

Thanks.

---------------------------------------------------------------------
Mário André
Instituto Federal de Educação, Ciência e Tecnologia de Sergipe - IFS
Mestrando em MCC - Universidade Federal de Alagoas - UFAL
http://www.marioandre.com.br/
Skype: mario-fa
----------------------------------------------------------------------------
----------




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message