[Xapian-discuss] stemming problems with perl interface

Matthias Zeichmann matthias at volltext.net
Thu Dec 29 12:38:17 GMT 2005


hi list,

i am having trouble getting german stemming to work correctly; at least it
appears like the stemmers of Search::Xapian::QueryParser and
Search::Xapian::Stem yield different results for german.

example code:
---------->8---------------------------
#!/usr/bin/perl

use strict; use warnings;

use Search::Xapian qw(:standard);

my  $db = Search::Xapian::Database->new('test');
my  $qp = new Search::Xapian::QueryParser( $db );

    $qp->set_stemming_options("german",1);

my  $srch = 'türen';   # iso-8859-1
my  $q = $qp->parse_query($srch);
my  $stem = Search::Xapian::Stem->new('german');
warn "VERSION:". $Search::Xapian::VERSION;
warn "DESC:". $q->get_description;
warn "STEM:". $stem->stem_word($srch);
---------->8---------------------------

gives this output:
---------->8---------------------------
VERSION:0.9.2.1 at search line 15.
DESC:Xapian::Query(tuer:(pos=1)) at search line 16.
STEM:tur at search line 17.
---------->8---------------------------

with english stemmer i get:
---------->8---------------------------
VERSION:0.9.2.1 at search line 15.
DESC:Xapian::Query(tueren:(pos=1)) at search line 16.
STEM:türen at search line 17.
---------->8---------------------------


thanks for consideration
cheers matt




More information about the Xapian-discuss mailing list