AI::Categorizer::Category - A named category of documents
my $category = AI::Categorizer::Category->by_name("sports"); my $name = $category->name; my @docs = $category->documents; my $num_docs = $category->documents; my $features = $category->features; $category->add_document($doc); if ($category->contains_document($doc)) { ...
This simple class represents a named category which may contain zero or more documents. Each category is a "singleton" by name, so two Category objects with the same name should not be created at once.
Creates a new Category object and returns it. Accepts the following parameters:
The name of this category
A reference to an array of Document objects that should belong to this category.
Returns the Category object with the given name, or creates one if no such object exists.
Returns a list of the Document objects in this category in a list context, or the number of such objects in a scalar context.
Returns a FeatureVector object representing the sum of all the FeatureVectors of the Documents in this Category.
Informs the Category that the given Document belongs to it.
Returns true if the given document belongs to this category, or false otherwise.
Ken Williams, ken@mathforum.org
Copyright 2000-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.
AI::Categorizer(3), Storable(3)
To install AI::Categorizer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AI::Categorizer
CPAN shell
perl -MCPAN -e shell install AI::Categorizer
For more information on module installation, please visit the detailed CPAN module installation guide.