[Snowball-discuss] Why not abstract Snowball Java?

Mike Wertheim mike.wertheim at gmail.com
Fri Jan 18 17:56:27 GMT 2008


I would love it if the language-specific stemmers were subclases of
SnowballProgram, so that the usage looked something like this:

SnowballProgram stemmer = new GermanStemmer();
String stem = stemmer.getStem(word);


On Jan 18, 2008 9:15 AM, Karl Wettin <karl.wettin at gmail.com> wrote:

>
> 18 jan 2008 kl. 13.44 skrev Karl Wettin:
>
> > How is it that the snowball program is not abstract and has the
> > abstract method stem()?
>
>
> It is so much more expesive to do the now required reflection to stem.
>
> Index: java/org/tartarus/snowball/SnowballProgram.java
> ===================================================================
> --- java/org/tartarus/snowball/SnowballProgram.java     (revision 500)
> +++ java/org/tartarus/snowball/SnowballProgram.java     (working copy)
> @@ -2,13 +2,15 @@
>  package org.tartarus.snowball;
>  import java.lang.reflect.InvocationTargetException;
>
> -public class SnowballProgram {
> +public abstract class SnowballProgram {
>      protected SnowballProgram()
>      {
>        current = new StringBuffer();
>        setCurrent("");
>      }
>
> +    public abstract boolean stem();
> +
>      /**
>       * Set the current string.
>       */
>
>
> _______________________________________________
> Snowball-discuss mailing list
> Snowball-discuss at lists.tartarus.org
> http://lists.tartarus.org/mailman/listinfo/snowball-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.tartarus.org/mailman/private/snowball-discuss/attachments/20080118/5146e481/attachment.htm


More information about the Snowball-discuss mailing list