lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brendan Grainger <brendan.grain...@gmail.com>
Subject Question about startOffset and endOffset
Date Mon, 12 May 2008 16:06:06 GMT
Hi,

I have a TokenStream that inserts synonym tokens into the stream when  
matched. One thing I am wondering about is what is the effect of the  
startOffset and endOffset. I have something like this:

Token synonymToken = new Token(originalToken.startOffset(),  
originalToken.endOffset(), "SYNONYM");
synonymToken.setPositionIncrement(0);

What I am wondering is if I set the startOffset and endOffset to 0 and  
the endOffset to the length of the synonym string what effect will  
this have?

eg
Token synonymToken = new Token(0, repTok.endOffset(), "SYNONYM");
synonymToken.setPositionIncrement(0);

Thanks


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message