I'm writing a TokenFilter and am confused about why class Token has
both an *endOffset* and a *termLength* field.  It would appear that
the following invariant should always hold for a Token instance:

    termLength() == endOffset() - startOffset()

If so, then

1) Why 2 fields, instead of 1?
2) Why isn't the invariant enforced in the class?

-Babak

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

Reply via email to