FAQ
Hi,

I'm rather new to Lucene and could use some help.

My Analyzer uses a set of filters (PorterStemFilter, LowerCaseFilter,
WhitespaceTokenizer). I need to replicate the effect of these filters
outside of the normal Lucene pipeline. Basically I would like to input a
String from one end and get a processed String or String[] from the
other end.

Is there a good way to do this? I'm trying to figure it out myself but
in case I fail, maybe someone from here could give some advice?

Thank You!
Marek

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

Search Discussions

  • Joel Halbert at May 14, 2009 at 11:23 am
    You can use your Analyzer to get a token stream from any text you give
    it, just like Lucene does.

    Something like:



    String text = "your list of words to analyze and tokenize";

    TokenStream ts = YOUR_ANALYZER.tokenStream(null, new
    StringReader(text));
    Token token = new Token();

    while((ts.next(token)) != null) {
    String t = new String(token.termBuffer()).substring(0,
    token.termLength());
    System.out.println("Got token " + t);
    }



    -----Original Message-----
    From: Marek Rei <mr472@chu.cam.ac.uk>
    Reply-To: java-user@lucene.apache.org
    To: java-user@lucene.apache.org
    Subject: analysis filter wrapper
    Date: Thu, 14 May 2009 11:57:57 +0100

    Hi,

    I'm rather new to Lucene and could use some help.

    My Analyzer uses a set of filters (PorterStemFilter, LowerCaseFilter,
    WhitespaceTokenizer). I need to replicate the effect of these filters
    outside of the normal Lucene pipeline. Basically I would like to input a
    String from one end and get a processed String or String[] from the
    other end.

    Is there a good way to do this? I'm trying to figure it out myself but
    in case I fail, maybe someone from here could give some advice?

    Thank You!
    Marek

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



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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedMay 14, '09 at 10:58a
activeMay 14, '09 at 11:23a
posts2
users2
websitelucene.apache.org

2 users in discussion

Marek Rei: 1 post Joel Halbert: 1 post

People

Translate

site design / logo © 2022 Grokbase