lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Spencer <dave-lucene-u...@tropo.com>
Subject Re: DocumentWriter, StopFilter should use HashMap... (patch)
Date Tue, 09 Mar 2004 18:48:36 GMT

Maybe I missed something but I always thought the stop list should be a 
Set, not a Map (or Hashtable/Dictionary). After all, all you need to 
know is existence and that's what a Set does.

Doug Cutting wrote:

> Erik Hatcher wrote:
> 
>> Well, one issue you didn't consider is changing a public method 
>> signature.  I will make this change, but leave the Hashtable signature 
>> method there.  I suppose we could change the signature to use a Map 
>> instead, but I believe there are some issues with doing something like 
>> this if you do not recompile your own source code against a new Lucene 
>> JAR.... so I will simply provide another signature too.
> 
> 
> This is also a problem for folks who're implementing analyzers which use 
> StopFilter.  For example:
> 
> public MyAnalyzer extends Analyzer {
> 
>   private static Hashtable stopTable =
>     StopFilter.makeStopTable(stopWords);
> 
>   public TokenStream tokenStream(String field, Reader reader) {
>     ... new StopFilter(stopTable) ...
> 
> }
> 
> This would no longer compile with the change Kevin proposes.
> 
> To make things back-compatible we must:
> 
> 1. Keep but deprectate StopFilter(Hashtable) constructor;
> 2. Keep but deprecate StopFilter.makeStopTable(String[]);
> 3. Add a new constructor: StopFilter(HashMap);
> 4. Add a new method: StopFilter.makeStopMap(String[]);
> 
> Does that make sense?
> 
> Doug
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message