Changeset 17209


Ignore:
Timestamp:
2008-09-08T12:35:53+12:00 (16 years ago)
Author:
kjdon
Message:

BasClas renamed to BaseClassifier, tidied up constructors

Location:
gsdl/trunk/perllib/classify
Files:
17 edited

Legend:

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

    r12891 r17209  
    2424###########################################################################
    2525# classifier plugin for sorting alphabetically
    26 # options are:
    2726
    2827package AZCompactList;
    2928
    30 use BasClas;
     29use BaseClassifier;
    3130use sorttools;
    3231
     
    3534
    3635sub BEGIN {
    37     @AZCompactList::ISA = ('BasClas');
     36    @AZCompactList::ISA = ('BaseClassifier');
    3837}
    3938
     
    123122    push(@$pluginlist, $class);
    124123
    125     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    126     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    127 
    128     my $self = new BasClas($pluginlist, $inputargs, $hashArgOptLists);
     124    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     125    push(@{$hashArgOptLists->{"OptList"}},$options);
     126
     127    my $self = new BaseClassifier($pluginlist, $inputargs, $hashArgOptLists);
    129128
    130129    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/classify/AZCompactSectionList.pm

    r12891 r17209  
    3131    push(@$classifierslist, $class);
    3232
    33     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    34     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    35 
     33    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     34    push(@{$hashArgOptLists->{"OptList"}},$options);
     35   
    3636    my $self = new AZCompactList($classifierslist, $inputargs, $hashArgOptLists);
    3737
  • gsdl/trunk/perllib/classify/AZList.pm

    r15891 r17209  
    2828package AZList;
    2929
    30 use BasClas;
     30use BaseClassifier;
    3131use sorttools;
    3232
     
    3535
    3636sub BEGIN {
    37     @AZList::ISA = ('BasClas');
     37    @AZList::ISA = ('BaseClassifier');
    3838}
    3939
     
    6868    push(@$classifierslist, $class);
    6969
    70     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    71     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    72 
    73     my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
     70    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     71    push(@{$hashArgOptLists->{"OptList"}},$options);
     72
     73    my $self = new BaseClassifier($classifierslist, $inputargs, $hashArgOptLists);
    7474
    7575    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/classify/AZSectionList.pm

    r12891 r17209  
    6161    push(@$classifierslist, $class);
    6262
    63     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    64     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     63    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     64push(@{$hashArgOptLists->{"OptList"}},$options);
    6565
    6666    my $self = new AZList($classifierslist, $inputargs, $hashArgOptLists);
  • gsdl/trunk/perllib/classify/AllList.pm

    r12891 r17209  
    2626package AllList;
    2727
    28 use BasClas;
     28use BaseClassifier;
    2929
    3030use strict;
     
    3232
    3333sub BEGIN {
    34     @AllList::ISA = ('BasClas');
     34    @AllList::ISA = ('BaseClassifier');
    3535}
    3636
     
    4141my $options = { 'name'     => "AllList",
    4242        'desc' => "{AllList.desc}",
    43             'abstract' => "no",
     43            'abstract' => "yes", # hide from gli
    4444            'inherits' => "yes" };
    4545
     
    4949    push(@$classifierslist, $class);
    5050
    51     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    52     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     51    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     52    push(@{$hashArgOptLists->{"OptList"}},$options);
    5353
    54     my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
     54    my $self = new BaseClassifier($classifierslist, $inputargs, $hashArgOptLists);
    5555   
    5656    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/classify/BaseClassifier.pm

    r17208 r17209  
    11###########################################################################
    22#
    3 # BasClas.pm -- base class for all classifiers
     3# BaseClassifier.pm -- base class for all classifiers
    44#
    55# A component of the Greenstone digital library software
     
    2525###########################################################################
    2626
    27 package BasClas;
     27package BaseClassifier;
    2828
    2929# How a classifier works. 
    3030#
    3131# For each classifier requested in the collect.cfg file, buildcol.pl creates
    32 # a new classifier object (a subclass of BasClas).  Later, it passes each
     32# a new classifier object (a subclass of BaseClassifier).  Later, it passes each
    3333# document object to each classifier in turn for classification.
    3434#
     
    9595      ];
    9696
    97 my $options = { 'name'     => "BasClas",
     97my $options = { 'name'     => "BaseClassifier",
    9898        'desc'     => "{BasClas.desc}",
    9999        'abstract' => "yes",
     
    243243    my $classifier_name = (defined $classifierslist->[0]) ? $classifierslist->[0] : $class;
    244244
    245     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    246     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     245    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     246    push(@{$hashArgOptLists->{"OptList"}},$options);
    247247
    248248
     
    303303
    304304    my $outhandle = $self->{'outhandle'};
    305     &gsprintf($outhandle, "BasClass::classify {common.must_be_implemented}\n");
     305    &gsprintf($outhandle, "BaseClassifier::classify {common.must_be_implemented}\n");
    306306}
    307307
     
    310310
    311311    my $outhandle = $self->{'outhandle'};
    312     &gsprintf($outhandle, "BasClass::get_classify_info {common.must_be_implemented}\n");
     312    &gsprintf($outhandle, "BaseClassifier::get_classify_info {common.must_be_implemented}\n");
    313313}
    314314
  • gsdl/trunk/perllib/classify/Browse.pm

    r12891 r17209  
    11###########################################################################
    22#
    3 # List.pm --
     3# Browse.pm --
    44# A component of the Greenstone digital library software
    55# from the New Zealand Digital Library Project at the
     
    2424###########################################################################
    2525
    26 # 12/05/02 Added usage datastructure - John Thompson
    27 
    2826package Browse;
    2927
    30 use BasClas;
     28use BaseClassifier;
    3129use sorttools;
    3230
     
    3533
    3634sub BEGIN {
    37     @Browse::ISA = ('BasClas');
     35    @Browse::ISA = ('BaseClassifier');
    3836}
    3937
     
    5149    push(@$classifierslist, $class);
    5250
    53     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    54     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     51    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     52    push(@{$hashArgOptLists->{"OptList"}},$options);
    5553
    56     my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
     54    my $self = new BaseClassifier($classifierslist, $inputargs, $hashArgOptLists);
    5755
    5856    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/classify/Collage.pm

    r12891 r17209  
    2626package Collage;
    2727
    28 use BasClas;
     28use BaseClassifier;
    2929use sorttools;
    3030
     
    3333
    3434sub BEGIN {
    35     @Collage::ISA = ('BasClas');
     35    @Collage::ISA = ('BaseClassifier');
    3636}
    3737
     
    5757    'deft' => "500"},
    5858#      { 'name' => "maxDownloads",
    59 #   'desc' => "{BasClas.maxDownloads}",
     59#   'desc' => "{Collage.maxDownloads}",
    6060#   'type' => "string",
    6161#   'deft' => "",
     
    113113    push(@$classifierslist, $class);
    114114
    115     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    116     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    117 
    118     my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
     115    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     116    push(@{$hashArgOptLists->{"OptList"}},$options);
     117
     118    my $self = new BaseClassifier($classifierslist, $inputargs, $hashArgOptLists);
    119119   
    120120    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/classify/DateList.pm

    r12891 r17209  
    4040package DateList;
    4141
    42 use BasClas;
     42use BaseClassifier;
    4343use sorttools;
    4444
     
    4747
    4848sub BEGIN {
    49     @DateList::ISA = ('BasClas');
     49    @DateList::ISA = ('BaseClassifier');
    5050}
    5151
     
    9191    push(@$classifierslist, $class);
    9292
    93     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    94     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    95 
    96     my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
     93    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     94    push(@{$hashArgOptLists->{"OptList"}},$options);
     95
     96    my $self = new BaseClassifier($classifierslist, $inputargs, $hashArgOptLists);
    9797
    9898    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/classify/GenericList.pm

    r14845 r17209  
    3535
    3636
    37 use BasClas;
     37use BaseClassifier;
    3838
    3939use strict;
     
    4141
    4242sub BEGIN {
    43     @GenericList::ISA = ('BasClas');
     43    @GenericList::ISA = ('BaseClassifier');
    4444}
    4545
     
    9292    push(@$classifierslist, $class);
    9393
    94     if (defined $arguments) { push(@{$hashArgOptLists->{"ArgList"}}, @{$arguments}); }
    95     if (defined $options) { push(@{$hashArgOptLists->{"OptList"}}, $options); }
    96 
    97     my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
     94    push(@{$hashArgOptLists->{"ArgList"}}, @{$arguments});
     95    push(@{$hashArgOptLists->{"OptList"}}, $options);
     96
     97    my $self = new BaseClassifier($classifierslist, $inputargs, $hashArgOptLists);
    9898
    9999    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/classify/HFileHierarchy.pm

    r12891 r17209  
    2929package HFileHierarchy;
    3030
    31 use BasClas;
     31use BaseClassifier;
    3232use util;
    3333use cfgread;
     
    3838
    3939sub BEGIN {
    40     @HFileHierarchy::ISA = ('BasClas');
     40    @HFileHierarchy::ISA = ('BaseClassifier');
    4141}
    4242
     
    9090    push(@$classifierslist, $class);
    9191
    92     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    93     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    94 
    95     my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
     92    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     93    push(@{$hashArgOptLists->{"OptList"}},$options);
     94
     95    my $self = new BaseClassifier($classifierslist, $inputargs, $hashArgOptLists);
    9696
    9797    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/classify/HTML.pm

    r12891 r17209  
    2929package HTML;
    3030
    31 use BasClas;
     31use BaseClassifier;
    3232
    3333use strict;
     
    3535
    3636sub BEGIN {
    37     @HTML::ISA = ('BasClas');
     37    @HTML::ISA = ('BaseClassifier');
    3838}
    3939
     
    6161    push(@$classifierslist, $class);
    6262
    63     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    64     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     63    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     64    push(@{$hashArgOptLists->{"OptList"}},$options);
    6565
    66     my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
     66    my $self = new BaseClassifier($classifierslist, $inputargs, $hashArgOptLists);
    6767
    6868    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/classify/Hierarchy.pm

    r12891 r17209  
    7272    push(@$classifierslist, $class);
    7373
    74     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    75     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     74    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     75    push(@{$hashArgOptLists->{"OptList"}},$options);
    7676
    7777    my $self = new HFileHierarchy($classifierslist, $inputargs, $hashArgOptLists);
  • gsdl/trunk/perllib/classify/List.pm

    r12891 r17209  
    2727# to see the options, run "perl -S classinfo.pl List"
    2828
    29 use BasClas;
     29use BaseClassifier;
    3030package List;
    3131
     
    3636
    3737sub BEGIN {
    38     @List::ISA = ('BasClas');
     38    @List::ISA = ('BaseClassifier');
    3939}
    4040
     
    6262    push(@$classifierslist, $class);
    6363
    64     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    65     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    66 
    67     my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
     64    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     65    push(@{$hashArgOptLists->{"OptList"}},$options);
     66
     67    my $self = new BaseClassifier($classifierslist, $inputargs, $hashArgOptLists);
     68
     69    if ($self->{'info_only'}) {
     70    # don't worry about any options etc
     71    return bless $self, $class;
     72    }
    6873
    6974    # Transfer value from Auto Parsing to the variable name that used in previous GreenStone.
  • gsdl/trunk/perllib/classify/Phind.pm

    r12891 r17209  
    3434package Phind;
    3535
    36 use BasClas;
     36use BaseClassifier;
    3737use util;
    3838use ghtml;
     
    5959
    6060sub BEGIN {
    61     @Phind::ISA = ('BasClas');
     61    @Phind::ISA = ('BaseClassifier');
    6262}
    6363
     
    157157    push(@$classifierslist, $class);
    158158
    159     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    160     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    161 
    162     my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
     159    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     160    push(@{$hashArgOptLists->{"OptList"}},$options);
     161
     162    my $self = new BaseClassifier($classifierslist, $inputargs, $hashArgOptLists);
    163163
    164164    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/classify/RecentDocumentsList.pm

    r13900 r17209  
    2727# to see the options, run "perl -S classinfo.pl RecentDocumentsList"
    2828
    29 use BasClas;
    3029package RecentDocumentsList;
    3130
     31use BaseClassifier;
    3232use strict;
    3333no strict 'refs'; # allow filehandles to be variables and viceversa
     
    3636
    3737sub BEGIN {
    38     @RecentDocumentsList::ISA = ('BasClas');
     38    @RecentDocumentsList::ISA = ('BaseClassifier');
    3939}
    4040
     
    6868    push(@$classifierslist, $class);
    6969
    70     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    71     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    72 
    73     my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
     70    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     71    push(@{$hashArgOptLists->{"OptList"}},$options);
     72
     73    my $self = new BaseClassifier($classifierslist, $inputargs, $hashArgOptLists);
    7474
    7575    if ($self->{'info_only'}) {
  • gsdl/trunk/perllib/classify/SectionList.pm

    r12891 r17209  
    2828# itself
    2929
    30 # 12/05/02 Added usage datastructure - John Thompson
    3130
    3231package SectionList;
     
    5453    push(@$classifierslist, $class);
    5554
    56     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    57     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     55    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     56    push(@{$hashArgOptLists->{"OptList"}},$options);
    5857
    5958    my $self = new List($classifierslist, $inputargs, $hashArgOptLists);
Note: See TracChangeset for help on using the changeset viewer.