[Xapian-discuss] FW: Wondering about the n-gram QP ?

Tom Leitch tom.leitch at gmail.com
Wed Jul 22 12:27:15 BST 2009

2009/7/22 Olly Betts <olly at survex.com>

> On Wed, Jul 22, 2009 at 12:03:37PM +0100, Tom Leitch wrote:
> > We had attempted to create a Perl module which has the same interface as
> > Xapian::Search::Stem (i.e. new() and stem_word()) and then say
> > $qp->set_stemmer(new PurePerlNGramStemmer());
> >
> > However we were thwarted by this error message
> > "Search::Xapian::QueryParser::set_stemmer() -- stemmer is not a blessed
> SV
> > reference".  Might there be a way we could trick QueryParser into using a
> > pure Perl module, rather than an opaque C++ object ?
> No, the C++ class system doesn't support "duck typing", so that approach
> is just not going to fly.
> You can't currently subclass from Xapian::Stem either.
> But how would this work anyway?  Xapian::Stem::stem_word() doesn't
> support returning more than one result, so you can't return all the
> n-grams for the word you are passed.

Ahh yes - a very pertinent point. That would have been problem to solve #2.

I guess it's probably easier if we wait for the official release to support

Thanks for the response Olly.


More information about the Xapian-discuss mailing list