1AI::Categorizer::CollecUtsieorn:C:oFnitlreisb(u3t)ed PerAlI:D:oCcautmeegnotraitzieorn::Collection::Files(3)
2
3
4
6 AI::Categorizer::Collection::Files - One document per file
7
9 my $c = new AI::Categorizer::Collection::Files
10 (path => '/tmp/docs/training',
11 category_file => '/tmp/docs/cats.txt');
12 print "Total number of docs: ", $c->count_documents, "\n";
13 while (my $document = $c->next) {
14 ...
15 }
16 $c->rewind; # For further operations
17
19 This implements a Collection class in which each document exists as a
20 single file on a filesystem. The documents can exist in a single
21 directory, or in several directories.
22
24 This is a subclass of the abstract AI::Categorizer::Collection class,
25 so any methods mentioned in its documentation are available here.
26
27 new()
28 Creates a new Collection object and returns it. In addition to the
29 parameters accepted by the superclass, the following parameters are
30 accepted:
31
32 path
33 Indicates a location on disk where the documents can be found.
34 The path may be specified as a string giving the name of a
35 directory, or as a reference to an array of such strings if the
36 documents are located in more than one directory.
37
38 recurse
39 Indicates whether subdirectories of the directory (or
40 directories) in the "path" parameter should be descended into.
41 If set to a true value, they will be descended into. If false,
42 they will be ignored. The default is false.
43
45 Ken Williams, ken@mathforum.org
46
48 Copyright 2002-2003 Ken Williams. All rights reserved.
49
50 This library is free software; you can redistribute it and/or modify it
51 under the same terms as Perl itself.
52
54 AI::Categorizer::Collection(3)
55
56
57
58perl v5.28.1 2019-02-A0I2::Categorizer::Collection::Files(3)