[Snowball-discuss] bug in the java version: "cannot be cast to org.tartarus.snowball.SnowballStemmer"

Luangsay Sourygna luangsay at gmail.com
Wed Mar 16 08:17:43 GMT 2016


Thanks Olly.
I've just tried it with "-p ..." and it works great.

Sure, if people only use snowball to implement stemmers, then I think
changing the default behaviour would be a good idea.

Sourygna

On Tue, Mar 15, 2016 at 8:59 PM, Olly Betts <olly at survex.com> wrote:

> On Tue, Mar 15, 2016 at 08:14:17PM +0000, Luangsay Sourygna wrote:
> > As a workaround, I do a quick sed on the generated java class. In my
> case:
> > sed -i
> >
> "s/org.tartarus.snowball.SnowballProgram/org.tartarus.snowball.SnowballStemmer/"
> > java/org/tartarus/snowball/ext/DutchKraaijPohlmannStemmer.java
>
> There's no need to post-process like this - you can specify the parent
> class to inherit from by using -p when you run the snowball compiler -
> e.g.
>
>   -p org.tartarus.snowball.SnowballStemmer
>
> > (by default my generated class
> > extends org.tartarus.snowball.SnowballProgram. And it seems like it
> should
> > extend org.tartarus.snowball.SnowballStemmer instead).
>
> I think the idea behind this design was that snowball is a
> general-purpose string processing language, and SnowballProgram
> encapsulates that, while SnowballStemmer encapsulates the use of it to
> implement stemming algorithms.
>
> In practice, I'm not aware of anyone who actually uses snowball for
> anything else, making the distinction somewhat moot, and the default
> behaviour arguably a bit unhelpful.
>
> Cheers,
>     Olly
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tartarus.org/mailman/private/snowball-discuss/attachments/20160316/9fb601fc/attachment.html>


More information about the Snowball-discuss mailing list