Ignore:
Timestamp:
2000-08-31T20:05:25+12:00 (24 years ago)
Author:
sjboddie
Message:

added -out option to classifiers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/classify/AZList.pm

    r837 r1483  
    3434package AZList;
    3535
     36use BasClas;
    3637use sorttools;
     38
     39sub BEGIN {
     40    @ISA = ('BasClas');
     41}
    3742
    3843sub new {
    3944    my ($class, @options) = @_;
     45    my $self = new BasClas ($class, @_);
    4046
    4147    my ($metaname, $title);
     
    4955    }
    5056
    51     die "AZList used with no metadata name to classify by\n"
    52     unless defined $metaname;
     57    if (!defined $metaname) {
     58    my $outhandle = $self->{'outhandle'};
     59    print $outhandle "AZList used with no metadata name to classify by\n";
     60    die "\n";
     61    }
     62
    5363    $title = $metaname unless defined $title;
    5464
    55     return bless {
    56     'list'=>{},
    57     'metaname' => $metaname,
    58     'title' => $title
    59     }, $class;
     65    $self->{'list'} = {};
     66    $self->{'metaname'} = $metaname;
     67    $self->{'title'} = $title;
     68
     69    return bless $self, $class;
    6070}
    6171
     
    8393    }
    8494    if (defined $self->{'list'}->{$doc_OID}) {
    85         print STDERR "WARNING: AZList::classify called multiple times for $doc_OID\n";
     95        my $outhandle = $self->{'outhandle'};
     96        print $outhandle "WARNING: AZList::classify called multiple times for $doc_OID\n";
    8697    }
    8798    $self->{'list'}->{$doc_OID} = $metavalue;
     
    164175    if ($title =~ /^[0-9]$/) {$title = '0-9';}
    165176    elsif ($title !~ /^[A-Z]$/) {
    166         print STDERR "AZList: WARNING $classification has badly formatted title ($title)\n";
     177        my $outhandle = $self->{'outhandle'};
     178        print $outhandle "AZList: WARNING $classification has badly formatted title ($title)\n";
    167179    }
    168180    $classhash->{$title} = [] unless defined $classhash->{$title};
Note: See TracChangeset for help on using the changeset viewer.