hi Maxim ,
you need to reset the tokenStream before the while loop - tokenStream .reset
()
check out
http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/analysis/package-summary.html
look under "invoking the analyzer" :
"ts.reset(); // Resets this stream to the beginning. (Required)"
Hi!
I try to use WhitespaceAnalyzer from Lucene 4.0 for splitting strings to words.
I wrote smal test:
@Test
public void whitespaceAnalyzerTest() throws IOException {
String string = "sdfdsf sdfsdf sd sdf ";
Analyzer wa = new WhitespaceAnalyzer(Version.LUCENE_40);
TokenStream tokenStre