ExtractWords(3)

πŸ“¦
version 0.08 Β· 2 versions
, in fedora 43

πŸ’– ExtractWords β€” the manual, but make it a group chat πŸ’–

okay bestie so this is Text::ExtractWords, a Perl extension for extracting words from strings. it lives in the User Contributed Perl Documentation section of the manual, page ExtractWords(3), and honestly? it's giving ✨text-processing icon✨. let's get into it 🫢


✨ NAME ✨

Text::ExtractWords β€” Perl extension for extract words from strings πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole vibe, copy-paste ready, no edits, no notes:

  use Text::ExtractWords qw(words_count words_list);

  my %hash = ();
  my %config = (
    minwordlen => 2,
    maxwordlen => 32,
    locale     => "pt_PT.ISO_8859-1",
  );
  words_count(\%hash, "test the words_count function", \%config);

  my @list = ();
  words_list(\@list, "test the words_list function", \%config);

see how it's just… chef's kiss? two functions, one config hash, done. periodt πŸŽ€


🌸 DESCRIPTION 🌸

so the aim of this module is to extract the words from the texts or mails to identify spam. but β€” and this is the part where it gets fun β€” it can be used for another purpose. it's not a one-trick pony, it's a main character 🌈


πŸ‘‘ METHODS πŸ‘‘

πŸ’œ words_count(HASHREF, STRING, HASHREF)

Extract words from a string to hash reference and count the number of occurrences for each word.

so you hand it a hash ref, it fills that hash up with words and how many times each one showed up. frequency check, vibe check, same thing πŸ’…

πŸ“ words_list(ARRAYREF, STRING, HASHREF)

Extract words from a string to array reference.

same energy, different container: you get a list back instead of a tally. simple as that, no cap ✨


πŸ’– AUTHOR πŸ’–

Henrique Dias <hdias@aesbuc.pt> β€” iconic, we stan 🫢


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page, bestie πŸ’€ no notes. this was perl v5.42.0, dated 2025-07-25, from the ExtractWords(3) page β€” mwah, go extract some words, you got this πŸŒŸπŸ’–

πŸ“¦ where this page comes from