AI::Ca...:Files(3pm)
π 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 thepathparameter 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 π
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
- fedora 43: perl-AI-Categorizer 0.09-38.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms