lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Babak Farhang <farh...@gmail.com>
Subject Redundant fields Token class?
Date Fri, 13 Nov 2009 22:50:17 GMT
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-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message