Olly Betts wrote:
> So I think it's better just to let applications decide if they want
> to select a stemmer based on $LANG.

Right, that's what I really meant, that the application decides if it
wants to use LANG, and if so passes it in to xapian, instead of trying
to convert from LANG to the internal language names used by xapian,
which would require a lookup table.

In my perl code, that looks like this:

                my $langcode=$ENV{LANG} || "en";
                $langcode=~s/_.*//;

                # This whitelist is here to work around a xapian bug (#486138)
                my @whitelist=qw{da de en es fi fr hu it no pt ru ro sv tr};

                if (grep { $_ eq $langcode } @whitelist) {
                        $stemmer=Search::Xapian::Stem->new($langcode);
                }
                else {
                        $stemmer=Search::Xapian::Stem->new("en");
                }

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature

Reply via email to