Lingua::Stem::Pt - Stemming algorithm for Portuguese
| Use Case | Command | Description |
|---|---|---|
| π₯ Load module | use Lingua::Stem::Pt; | Import the stemming module |
| πͺ Stem words | Lingua::Stem::Pt::stem({ -words => \@words, -locale => 'pt' }) | π Return arrayref of stemmed words |
| β οΈ Stem with exceptions | Lingua::Stem::Pt::stem({ -words => \@words, -locale => 'pt', -exceptions => \%exceptions }) | Override stemming for specific words |
| β‘ Enable caching per run | Lingua::Stem::Pt::stem_caching({ -level => 1 }) | Cache results during a single call |
| βΎοΈ Enable indefinite caching | Lingua::Stem::Pt::stem_caching({ -level => 2 }) | Cache results until cleared |
| ποΈ Clear stem cache | Lingua::Stem::Pt::clear_stem_cache() | Remove all cached stems |
use Lingua::Stem::Pt;
my $stems = Lingua::Stem::Pt::stem({ -words => $word_list_reference,
-locale => 'pt',
-exceptions => $exceptions_hash,
});
This routine applies a stemming algorithm to a passed anon array of Portuguese words, returning the stemmed words as an anon array.
It is a 'convenience' wrapper for 'Lingua::Stemmer::PT' that provides a standardized interface and caching.
Stems a list of passed words using the rules of Portuguese. Returns an anonymous array reference to the stemmed words.
Example:
my $stemmed_words = Lingua::Stem::Pt::stem({ -words => \@words,
-locale => 'pt',
-exceptions => \%exceptions,
});
Sets the level of stem caching.
π« '0' means 'no caching'. This is the default level.
β‘ '1' means 'cache per run'. This caches stemming results during a single call to 'stem'.
βΎοΈ '2' means 'cache indefinitely'. This caches stemming results until either the process exits or the 'clear_stem_cache' method is called.
Clears the cache of stemmed words
This code is a wrapper around Lingua::Stem::Snowball::Pt written by Ask Solem Hoel, <ask AT unixmonks.net>
Lingua::Stem Lingua::PT::Stemmer;
Integration in Lingua::Stem by Jerilyn Franz, FreeRun Technologies, <cpan AT jerilyn.info>
Jerilyn Franz, FreeRun Technologies
This code is freely available under the same terms as Perl.
Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 04:23 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format