[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-dev
Subject:    Should TokenFilter implement reset()
From:       "Shai Erera" <serera () gmail ! com>
Date:       2008-06-30 5:22:58
Message-ID: 786fde50806292222p3521f02fwe5329745fd18983d () mail ! gmail ! com
[Download RAW message or body]

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

[Attachment #3 (text/html)]

Hi<br><br>I was wondering if TokenFilter should implement reset(). The reason is it \
maintains an internal TokenStream instance, however never reset() that \
instance.<br><br>I&#39;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&#39; reset() never gets called.<br> <br>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?<br><br>&nbsp; public void reset() throws IOException \
{<br>&nbsp;&nbsp;&nbsp; super.reset();<br>&nbsp;&nbsp;&nbsp; input.reset();<br> \
&nbsp; }<br><br>Thanks,<br clear="all">Shai<br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic