lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomoko Uchida <>
Subject Re: Custom TokenStream + custom Attributes
Date Mon, 13 Jun 2016 00:34:02 GMT

I do not fully understand your requirements, but analyzers-kuromoji
(one of extended package for Japanese morphological analysis) has some
custom token attributes.

The implementation might be a good reference.

Hope that helps,

2016-06-08 20:44 GMT+09:00 Michal Krajňanský <>:
> Dear Lucene users,
> I have implemented a custom tokenizer (derived from TokenStream).
> I need to pass additional attributes to those standard in Lucene
> (PositionIncrementAttribute, OffsetAttribute), that would represent the
> word position in the tokenized sentence in the number of words and not
> characters, as one usually passes through OffsetAttribute. (I need both.)
> Is there a way of achieving this?
> I tried to implement own Attribute class (derive a new interface and
> implementing class). The code compiles ok but I am getting exception at
> runtime about the class casting.
> Thank you a lot in advance,
> MK

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message