Changeset 26267 for main/trunk/greenstone2/perllib
- Timestamp:
- 2012-09-27T14:24:22+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/classify/List.pm
r24193 r26267 108 108 'desc' => "{List.use_hlist_for}", 109 109 'type' => "string" }, 110 {'name' => "filter_metadata", 111 'desc' => "{List.filter_metadata}", 112 'type' => "metadata"}, 113 {'name' => "filter_regex", 114 'desc' => "{List.filter_regex}", 115 'type' => "regexp"}, 116 110 117 { 'name' => "removeprefix", 111 118 'desc' => "{BasClas.removeprefix}", … … 302 309 } 303 310 $self->{'all_doc_OIDs'}->{$doc_obj->get_OID()} = 1; 311 # check against filter here 312 if ($self->{'filter_metadata'}) { 313 #print STDERR "filtering documents on $self->{'filter_metadata'}\n"; 314 my $meta = $doc_obj->get_metadata_element($doc_obj->get_top_section(), $self->{'filter_metadata'}); 315 return unless defined $meta; 316 if ($self->{'filter_regex'} ne "" && $meta !~ /$self->{'filter_regex'}/) { 317 #print STDERR "doesn't match regex\n"; 318 return; 319 320 } 321 } 322 # if we get here, we have passed the test for filtering 304 323 # If "-classify_sections" is set, classify every section of the document 305 324 if ($self->{'classify_sections'}) { … … 324 343 my @metadata_groups = @{$self->{'metadata_groups'}}; 325 344 345 326 346 # Only classify the section if it has a value for one of the metadata elements in the first group 327 347 my $classify_section = 0;
Note:
See TracChangeset
for help on using the changeset viewer.