Lingua::Stem::Pt(3pm)

πŸ’… Lingua::Stem::Pt(3pm) β€” the Portuguese stemmer, bestie edition

Okay so picture this: it's a Perl manual page, it lives in the User Contributed Perl Documentation section, and it's called Lingua::Stem::Pt. That's the whole vibe. It stems Portuguese words. Slay. ✨


🌸 NAME 🌸

Lingua::Stem::Pt β€” the stemming algorithm for Portuguese, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

use Lingua::Stem::Pt;
my $stems   = Lingua::Stem::Pt::stem({ -words => $word_list_reference,
                                      -locale => 'pt',
                                  -exceptions => $exceptions_hash,
                                     });

Like, that's it. That's the whole entrance. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So this routine applies a stemming algorithm to a passed anon array of Portuguese words, and it returns the stemmed words as an anon array. Iconic behaviour, honestly.

It's basically a "convenience" wrapper for Lingua::Stemmer::PT that hands you a standardized interface plus caching. It's giving bestie-who-drives-you-places energy. πŸš—βœ¨


⭐ CHANGES ⭐

The lore, in order, oldest-ish to newest:

  • 2.31 2020.09.26 β€” fix for a Latin1/UTF8 issue in the documentation
  • 2.30 2020.06.20 β€” version renumber for module consistency
  • 1.01 2003.09.28 β€” documentation fix
  • 1.00 2003.04.05 β€” initial release πŸŽ‰

πŸ‘‘ METHODS πŸ‘‘

πŸ’– stem({ -words => \@words, -locale => 'pt', -exceptions => \%exceptions });

Stems a list of passed words using the rules of Portuguese. Returns an anonymous array reference to the stemmed words. Fr fr, that's the whole deal.

Example:

my $stemmed_words = Lingua::Stem::Pt::stem({ -words => \@words,
                                            -locale => 'pt',
                                        -exceptions => \%exceptions,
                        });

πŸ’œ stem_caching({ -level => 0|1|2 });

Sets the level of stem caching. Three levels, three moods, pick your fighter:

  • '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.

🧚 clear_stem_cache;

Clears the cache of stemmed words. Bye bestie, the memories are gone. 😭


πŸ”₯ NOTES πŸ”₯

This code is a wrapper around Lingua::Stem::Snowball::Pt, written by Ask Solem Hoel, <ask@unixmonks.net>. Giving credit where credit is due, periodt. 🫢


🌈 SEE ALSO 🌈

  • Lingua::Stem
  • Lingua::PT::Stemmer

Go read those, iykyk. πŸ‘€


πŸ’€ AUTHOR πŸ’€

Integration in Lingua::Stem by

Jerilyn Franz, FreeRun Technologies,
<cpan@jerilyn.info>

Jerilyn Franz, FreeRun Technologies

This code is freely available under the same terms as Perl.


πŸ™ˆ BUGS πŸ™ˆ

TODO

That's it. That's the bug list. Literally just TODO. We love a to-do that's been a to-do since forever. πŸ’€


And that's the page, bestie! πŸŽ€ This little beauty came from perl v5.42.0, dated 2020-09-27, and it's filed under Lingua::Stem::Pt(3pm) in the User Contributed Perl Documentation. Go forth and stem. πŸ’–βœ¨

πŸ“¦ where this page comes from