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 <[email protected]>
Reply-To: [email protected]
To: [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]