Re: bug in the java version: "cannot be cast to org.tartarus.snowball.SnowballStemmer"
Luangsay Sourygna <[email protected]> Wed, 16 Mar 2016 08:17:43 +0000
| Newsgroups | gmane.comp.search.snowball |
|---|---|
| Message-ID | <CAOTz1wAsmLVTG4wtmUvfigTXiLwdwtt1swxEeaoxPwahF4e3CQ@mail.gmail.com> |
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 <[email protected]> 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 > _______________________________________________ Snowball-discuss mailing list [email protected] http://lists.tartarus.org/mailman/listinfo/snowball-discuss