source: trunk/gsdl/perllib/classify/BasClas.pm@ 1483

Last change on this file since 1483 was 1483, checked in by sjboddie, 24 years ago

added -out option to classifiers

  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1###########################################################################
2#
3# BasClas.pm -- base class for all classifiers
4# A component of the Greenstone digital library software
5# from the New Zealand Digital Library Project at the
6# University of Waikato, New Zealand.
7#
8# Copyright (C) 2000 New Zealand Digital Library Project
9#
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program; if not, write to the Free Software
22# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23#
24###########################################################################
25
26package BasClas;
27
28
29sub new {
30 my ($class, @options) = @_;
31
32 my $self = {};
33
34 # this relies on the outpit handle always being
35 # the last thing in the list - it should be tidied
36 # up when the options are fixed up to use parseargv
37 $self->{'outhandle'} = pop @options;
38 if (!defined $self->{'outhandle'}) {
39 $self->{'outhandle'} = STDERR;
40 }
41
42 return bless $self, $class;
43}
44
45sub init {
46 my $self = shift (@_);
47}
48
49sub classify {
50 my $self = shift (@_);
51 my ($doc_obj) = @_;
52
53 my $outhandle = $self->{'outhandle'};
54 print $outhandle "BasClas::classify function must be implemented in sub-class\n";
55}
56
57sub get_classify_info {
58 my $self = shift (@_);
59
60 my $outhandle = $self->{'outhandle'};
61 print $outhandle "BasClas::classify function must be implemented in sub-class\n";
62}
63
641;
Note: See TracBrowser for help on using the repository browser.