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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to