Linas Valiukas > Lingua-Stem-Snowball-Lt-0.02 > Lingua::Stem::Snowball::Lt

Download:
Lingua-Stem-Snowball-Lt-0.02.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.02   Source   Latest Release: Lingua-Stem-Snowball-Lt-0.03

NAME ^

Lingua::Stem::Snowball::Lt - Perl interface to Snowball stemmer for the Lithuanian language.

SYNOPSIS ^

    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 );

DESCRIPTION ^

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).

METHODS / FUNCTIONS ^

new

    my $stemmer = Lingua::Stem::Snowball::Lt->new( );
    die $@ if $@;

Create a Lingua::Stem::Snowball::Lt object.

stem

    @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.

stem_in_place

    $stemmer->stem_in_place(\@words);

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.

AUTHORS ^

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.

COPYRIGHT AND LICENSE ^

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).

SEE ALSO ^

http://snowball.tartarus.org, Lingua::Stem::Snowball, Lingua::Stem.

syntax highlighting: