Changeset 6956
- Timestamp:
- 2004-03-08T12:41:23+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/BasClas.pm
r6945 r6956 210 210 211 211 212 # sub print_general_usage {213 # my ($plugin_name) = @_;214 # print STDERR "215 # -verbosity N Controls the quantity of output.216 # Defaults to verbosity of buildcol.pl, which is usually 2.217 218 # (Most general classifier options are set internally by buildcol.)219 220 # ";221 # }222 223 # sub print_usage {224 # print STDERR "225 # This classifier has no classifier-specific options226 #227 # ";228 # }229 230 212 sub new { 231 213 my $class = shift (@_); … … 247 229 248 230 &gsprintf(STDERR, "\n{BasClas.bad_general_option}\n", $name); 249 # print STDERR "\nThe $name classifier uses an incorrect general option\n";250 # print STDERR "(general options are those available to all classifiers).\n";251 # print STDERR "Check your collect.cfg configuration file.\n";252 231 $self->print_txt_usage(""); # Use default resource bundle 253 232 die "\n"; … … 267 246 my $outhandle = $self->{'outhandle'}; 268 247 &gsprintf($outhandle, "BasClass::classify {common.must_be_implemented}\n"); 269 # print $outhandle "BasClas::classify function must be implemented in sub-class\n";270 248 } 271 249 … … 275 253 my $outhandle = $self->{'outhandle'}; 276 254 &gsprintf($outhandle, "BasClass::get_classify_info {common.must_be_implemented}\n"); 277 # print $outhandle "BasClas::get_classify_info function must be implemented in sub-class\n"; 278 } 255 } 256 257 # all classifiers do something like this, but all slightly different 258 # so put it here so they can all share it. 259 sub format_metadata_for_sorting { 260 261 my $self = shift (@_); 262 263 my ($metaname, $metavalue, $doc_obj) = @_; 264 265 if ($metaname eq "Language") { 266 $metavalue = $iso639::fromiso639{$metavalue}; 267 return $metavalue; 268 } 269 270 my $lang = $doc_obj->get_metadata_element ($doc_obj->get_top_section(), 'Language'); 271 $lang = 'en' unless defined $lang; 272 if ($lang eq 'en') { 273 if ($metaname eq "Creator") { 274 &sorttools::format_string_name_english (\$metavalue); 275 } else { 276 &sorttools::format_string_english (\$metavalue); 277 } 278 } 279 return $metavalue; 280 } 281 279 282 280 283 1;
Note:
See TracChangeset
for help on using the changeset viewer.