lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera" <ser...@gmail.com>
Subject Re: Should TokenFilter implement reset()
Date Tue, 01 Jul 2008 13:00:28 GMT
Done. Thanks !

On Tue, Jul 1, 2008 at 3:40 PM, Michael McCandless <
lucene@mikemccandless.com> wrote:

>
> I think this makes sense.  Shai, could you open an issue & attach a patch?
>  Thanks.
>
> Mike
>
>
> Shai Erera wrote:
>
>  Hi
>>
>> I was wondering if TokenFilter should implement reset(). The reason is it
>> maintains an internal TokenStream instance, however never reset() that
>> instance.
>>
>> I'm using Lucene 2.3.0, and I have a set of TokenFilters which wrap each
>> other (i.e. TF1(TF2(TF3)))). Each extends TokenFilter() and implements
>> reset(). As part of the implementation it calls super.reset(). However, that
>> super.reset() goes to TokenStream.reset() which does nothing, therefore my
>> TokenFilter extensions' reset() never gets called.
>>
>> I implemented reset() in TokenFilter like that, and it solved my problem.
>> Is this the right approach? Am I using an old version of Lucene?
>>
>>  public void reset() throws IOException {
>>    super.reset();
>>    input.reset();
>>  }
>>
>> Thanks,
>> Shai
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>


-- 
Regards,

Shai Erera

Mime
View raw message