[Xapian-discuss] FW: Wondering about the n-gram QP ?
Olly Betts
olly at survex.com
Wed Jul 22 12:20:55 BST 2009
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.
Cheers,
Olly
More information about the Xapian-discuss
mailing list