AI::Ca...:Files(3pm)

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

πŸ’– AI::Categorizer::Collection::Files β€” one document per file πŸ’–

okay bestie, so this is a Perl module, it lives in the 3pm section of the manual, and its whole vibe is: every document is just one lil file sitting on a filesystem. that's it. that's the girl. πŸŽ€


✨ SYNOPSIS ✨

my $c = new AI::Categorizer::Collection::Files
  (path => '/tmp/docs/training',
   category_file => '/tmp/docs/cats.txt');
print "Total number of docs: ", $c->count_documents, "\n";
while (my $document = $c->next) {
  ...
}
$c->rewind; # For further operations

like, look at her go. constructor, count your docs, loop through them, rewind when you're done. main character behaviour honestly. πŸ‘‘


🌸 DESCRIPTION 🌸

so this implements a Collection class where each document exists as a single file on a filesystem. one doc = one file, no cap. 🫢

and the documents can all chill in a single directory</>, or they can be spread out across several directories</> β€” she's flexible like that. ✨


πŸ’… METHODS πŸ’…

ngl this is a subclass of the abstract AI::Categorizer::Collection class, so any methods mentioned in its documentation are available here too. she inherited them, she didn't have to work for them, iconic. 🧚

🌈 new()

Creates a new Collection object and returns it. obsessed. πŸ’–

on top of the parameters accepted by the superclass, she also accepts these:

  • path β€” points to a location on disk where the documents can be found πŸ‘€. you can pass it as a string giving the name of a directory, or as a reference to an array of such strings if your documents are located in more than one directory. so like, one dir or a whole list of dirs, dealer's choice.
  • recurse β€” tells her whether subdirectories of the directory (or directories) in the path parameter should be descended into πŸ¦‹. set it to a true value and yes, she'll descend into them. set it false and they get ignored, bye. the default is false.

πŸ‘‘ AUTHOR πŸ‘‘

Ken Williams, ken@mathforum.org


Copyright 2002-2003 Ken Williams. All rights reserved.

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


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page bestie, no notes. πŸ’… this was served up by perl v5.42.0, dated 2025-07-25, and honestly? she ate. mwah. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from