Lingua::Stem::Da(3pm)

πŸ’– Lingua::Stem::Da β€” the Danish stemmer, bestie πŸ’–

okay so this is a page from the User Contributed Perl Documentation for Lingua::Stem::Da(3pm) β€” yes that's the whole manual name, it's a whole vibe. Sit down, we're learning Danish stemming together ✨


🌸 NAME 🌸

Lingua::Stem::Da β€” the stemming algorithm for Danish, periodt πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

like, here's the whole thing you actually type, no cap:

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

that's it. that's the whole entry point. slay πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

so this routine applies a stemming algorithm to an anon array of Danish words that you pass in, and it hands you back the stemmed words as an anon array. simple as that, bestie.

it's a "convenience" wrapper for Lingua::Stem::Snowball::Da, and what it gives you on top is a standardized interface plus caching. that's the whole point. iykyk 🫢


🌈 CHANGES 🌈

the lore, chronologically β€” oldest at the bottom because that's how it's written:

  • 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 πŸ‘‘

the way this module has been around since 2003… iconic.


✨ METHODS ✨

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

stems a list of passed words using the rules of Danish. returns an anonymous array reference to the stemmed words. main character energy tbh πŸ‘‘

example β€” literally copy this:

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

🧚 stem_caching({ -level => 0|1|2 });

sets the level of stem caching. three levels, pick your fighter:

  • '0' means 'no caching'. this is the default level. it's giving minimal effort but honestly same 🫠
  • '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. that's it. fresh start, clean slate, new era πŸ’…


πŸ¦‹ NOTES πŸ¦‹

this code is a wrapper around Lingua::Stem::Snowball::Da, written by:

Dennis Haney <davh@davh.dk>

and

Ask Solem Hoel, <ask@unixmonks.net> (Swedish version)

shoutout to the og authors, we love credit where credit's due 🫢


⭐ SEE ALSO ⭐

go look at these too, bestie:

  • Lingua::Stem
  • Lingua::Stem::Snowball::Da

πŸ‘‘ 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

(yeah. that's the entire bugs section. it's giving "we'll deal with it later" and honestly? relatable πŸ˜­πŸ™ˆ)


and that's the whole page, bestie!! πŸ§šπŸ’œ it's from perl v5.42.0, dated 2020-09-27, and it lives at Lingua::Stem::Da(3pm) in the User Contributed Perl Documentation β€” go stem some Danish words, you've got this πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from