List of usage examples for org.apache.lucene.analysis.core WhitespaceAnalyzer getOffsetGap
public int getOffsetGap(String fieldName)
From source file:org.gridkit.coherence.search.lucene.TokenStreamCheck.java
License:Apache License
@Test public void analyze() throws IOException { WhitespaceAnalyzer wa = new WhitespaceAnalyzer(Version.LUCENE_42); wa.getOffsetGap("xxx"); TokenStream ts = wa.tokenStream("test", new StringReader("red black tree")); ts.reset();//from w w w . ja va 2 s . c om ts.incrementToken(); ts.getAttribute(CharTermAttribute.class).buffer(); CapturedTokenStream cts = new CapturedTokenStream(ts); cts.reset(); cts.incrementToken(); cts.getAttribute(CharTermAttribute.class).buffer(); }