Lingua::Stem::Snowball::Lt - Perl interface to Snowball stemmer for the Lithuanian language.
my @words = qw( niekada myliu ); # OO interface: my $stemmer = Lingua::Stem::Snowball::Lt->new( ); $stemmer->stem_in_place( \@words ); # qw( niekad myl ) # Functional interface: my @stems = stem( \@words );
Stemming reduces related words to a common root form -- for instance, "horse", "horses", and "horsing" all become "hors". Most commonly, stemming is deployed as part of a search application, allowing searches for a given term to match documents which contain other forms of that term.
This module is very similar to Lingua::Stem -- however, Lingua::Stem is pure Perl, while Lingua::Stem::Snowball::Lt is an XS module which provides a Perl interface to the C version of the Lithuanian stemmer based on Snowball. (http://snowball.tartarus.org).
my $stemmer = Lingua::Stem::Snowball::Lt->new( ); die $@ if $@;
Create a Lingua::Stem::Snowball::Lt object.
@stemmed = $stemmer->stem( WORDS, [IS_STEMMED] ); @stemmed = stem( WORDS, [LOCALE], [IS_STEMMED] );
Return lowercased and stemmed output. WORDS may be either an array of words or a single scalar word.
In a scalar context, stem() returns the first item in the array of stems:
$stem = $stemmer->stem($word); $first_stem = $stemmer->stem(\@words); # probably wrong
LOCALE has no effect; it is only there as a placeholder for backwards compatibility (see Changes). IS_STEMMED must be a reference to a scalar; if it is supplied, it will be set to 1 if the output differs from the input in some way, 0 otherwise.
This is a high-performance, streamlined version of stem() (in fact, stem() calls stem_in_place() internally). It has no return value, instead modifying each item in an existing array of words. The words must already be in lower case.
Lingua::Stem::Snowball was originally developed to provide access to stemming algorithms for the OpenFTS (full text search engine) project (http://openfts.sourceforge.net), by Oleg Bartunov, <oleg at sai dot msu dot su> and Teodor Sigaev, <teodor at stack dot net>.
Lingua::Stem::Snowball is currently maintained by Marvin Humphrey <marvin at rectangular dot com>. Previously maintained by Fabien Potencier <fabpot at cpan dot org>.
Lithuanian language adaptation (Lingua::Stem::Snowball::Lt) was done by Linas Valiukas. Lithuanian stemmer for Snowball was created by Å½. Medelis, M. PetkeviÄius and T. KrilaviÄius.
Perl bindings copyright 2004-2008 by Marvin Humphrey, Fabien Potencier, Oleg Bartunov and Teodor Sigaev.
Lithuanian language adaptation (Lingua::Stem::Snowball::Lt) copyright 2013 by Linas Valiukas.
This software may be freely copied and distributed under the same terms and conditions as Perl.
Snowball files and stemmers are covered by the BSD license.
Lithuanian stemmer (by Å½. Medelis, M. PetkeviÄius, T. KrilaviÄius) is covered by the Academic Free License (AFL).