<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Lingua::Stem::Any - Unified interface to any stemmer on CPAN

VERSION
    This document describes Lingua::Stem::Any v0.03.

SYNOPSIS
        use Lingua::Stem::Any;

        # create German stemmer using the default source module
        $stemmer = Lingua::Stem::Any-&gt;new(language =&gt; 'de');

        # create German stemmer explicitly using Lingua::Stem::Snowball
        $stemmer = Lingua::Stem::Any-&gt;new(
            language =&gt; 'de',
            source   =&gt; 'Lingua::Stem::Snowball',
        );

        # get stem for word
        $stem = $stemmer-&gt;stem($word);

        # get list of stems for list of words
        @stems = $stemmer-&gt;stem(@words);

DESCRIPTION
    This module aims to provide a simple unified interface to any stemmer on
    CPAN. It will provide a default available source module when a language
    is requested but no source is requested.

  Attributes
    All attribute-setting methods can be chained.

        $stem = $stemmer-&gt;language($language)-&gt;stem($word);

    language
        The following language codes are currently supported.

            в”Њв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”¬в”Ђв”Ђв”Ђв”Ђв”ђ
            в”‚ Bulgarian  в”‚ bg в”‚
            в”‚ Czech      в”‚ cs в”‚
            в”‚ Danish     в”‚ da в”‚
            в”‚ Dutch      в”‚ nl в”‚
            в”‚ English    в”‚ en в”‚
            в”‚ Esperanto  в”‚ eo в”‚
            в”‚ Finnish    в”‚ fi в”‚
            в”‚ French     в”‚ fr в”‚
            в”‚ Galician   в”‚ gl в”‚
            в”‚ German     в”‚ de в”‚
            в”‚ Hungarian  в”‚ hu в”‚
            в”‚ Ido        в”‚ io в”‚
            в”‚ Italian    в”‚ it в”‚
            в”‚ Latin      в”‚ la в”‚
            в”‚ Norwegian  в”‚ no в”‚
            в”‚ Persian    в”‚ fa в”‚
            в”‚ Portuguese в”‚ pt в”‚
            в”‚ Romanian   в”‚ ro в”‚
            в”‚ Russian    в”‚ ru в”‚
            в”‚ Spanish    в”‚ es в”‚
            в”‚ Swedish    в”‚ sv в”‚
            в”‚ Turkish    в”‚ tr в”‚
            в””в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”ґв”Ђв”Ђв”Ђв”Ђв”

        They are in the two-letter ISO 639-1 format and are case-insensitive
        but are always returned in lowercase when requested.

            # instantiate a stemmer object
            $stemmer = Lingua::Stem::Any-&gt;new(language =&gt; $language);

            # get current language
            $language = $stemmer-&gt;language;

            # change language
            $stemmer-&gt;language($language);

        The default language is `en' (English). Country codes such as `cz'
        for the Czech Republic are not supported, nor are IETF language tags
        such as `pt-PT' or `pt-BR'.

    source
        The following source modules are currently supported.

            в”Њв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”¬в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”ђ
            в”‚ Module                 в”‚ Languages                                    в”‚
            в”њв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”јв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”¤
            в”‚ Lingua::Stem::Snowball в”‚ da de en es fi fr hu it nl no pt ro ru sv tr в”‚
            в”‚ Lingua::Stem::UniNE    в”‚ bg cs de fa                                  в”‚
            в”‚ Lingua::Stem           в”‚ da de en fr gl it no pt ru sv                в”‚
            в”‚ Lingua::Stem::Patch    в”‚ eo io                                        в”‚
            в””в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”ґв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”

        A module name is used to specify the source. If no source is
        specified, the first available source in the above list with support
        for the current language is used.

            # get current source
            $source = $stemmer-&gt;source;

            # change source
            $stemmer-&gt;source('Lingua::Stem::UniNE');

    cache
        Boolean value specifying whether to cache the stem for each word.
        This will increase performance when stemming the same word multiple
        times at the expense of increased memory consumption. When enabled,
        the stems are cached for the life of the object or until the
        clear_cache method is called. The same cache is not shared among
        different languages, sources, or different instances of the stemmer
        object.

    exceptions
        Exceptions may be desired to bypass stemming for specific words and
        use predefined stems. For example, the plural English word `mice'
        will not stem to the singular word `mouse' unless it is specified in
        the exception dictionary. Another example is that by default the
        word `pants' will stem to `pant' even though stemming is normally
        not desired in this example. The exception dictionary can be
        provided as a hashref where the keys are language codes and the
        values are hashrefs of exceptions.

            # instantiate stemmer object with exceptions
            $stemmer = Lingua::Stem::Any-&gt;new(
                language   =&gt; 'en',
                exceptions =&gt; {
                    en =&gt; {
                        mice  =&gt; 'mouse',
                        pants =&gt; 'pants',
                    }
                }
            );

            # add/change exceptions
            $stemmer-&gt;exceptions(
                en =&gt; {
                    mice  =&gt; 'mouse',
                    pants =&gt; 'pants',
                }
            );

            # alternately...
            $stemmer-&gt;exceptions-&gt;{en} = {
                mice  =&gt; 'mouse',
                pants =&gt; 'pants',
            };

    casefold
        Boolean value specifying whether to apply Unicode casefolding to
        words before stemming them. This is enabled by default and is
        performed before normalization when also enabled.

    normalize
        Boolean value specifying whether to apply Unicode NFC normalization
        to words before stemming them. This is enabled by default and is
        performed after casefolding when also enabled.

  Methods
    stem
        Accepts a list of strings, stems each string, and returns a list of
        stems. The list returned will always have the same number of
        elements in the same order as the list provided. When no stemming
        rules apply to a word, the original word is returned.

            @stems = $stemmer-&gt;stem(@words);

            # get the stem for a single word
            $stem = $stemmer-&gt;stem($word);

        The words should be provided as character strings and the stems are
        returned as character strings. Byte strings in arbitrary character
        encodings are not supported.

    stem_in_place
        Accepts an array reference, stems each element, and replaces them
        with the resulting stems.

            $stemmer-&gt;stem_in_place(\@words);

        This method is provided for potential optimization when a large
        array of words is to be stemmed. The return value is not defined.

    languages
        Returns a list of supported two-letter language codes using
        lowercase letters.

            # all languages
            @languages = $stemmer-&gt;languages;

            # languages supported by Lingua::Stem::Snowball
            @languages = $stemmer-&gt;languages('Lingua::Stem::Snowball');

    sources
        Returns a list of supported source module names.

            # all sources
            @sources = $stemmer-&gt;sources;

            # sources that support English
            @sources = $stemmer-&gt;sources('en');

    clear_cache
        Clears the stem cache for all languages and sources of this object
        instance when the cache attribute is enabled. Does not affect
        whether caching is enabled.

SEE ALSO
    Lingua::Stem::Snowball, Lingua::Stem::UniNE, Lingua::Stem,
    Lingua::Stem::Patch

AUTHOR
    Nick Patch &lt;patch@cpan.org&gt;

    This project is brought to you by Shutterstock. Additional open source
    projects from Shutterstock can be found at code.shutterstock.com.

COPYRIGHT AND LICENSE
    В© 2013вЂ“2014 Shutterstock, Inc.

    This library is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

</pre></body></html>