Changeset 9142


Ignore:
Timestamp:
2005-02-23T10:04:07+13:00 (19 years ago)
Author:
davidb
Message:

Revision to Collaging so only documents with associated files that
match the list of imageType filename extension go into the classifier.

File:
1 edited

Legend:

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

    r7409 r9142  
    170170    my ($doc_obj) = @_;
    171171
    172     my $doc_OID = $doc_obj->get_OID();
    173     push (@{$self->{'list'}}, $doc_OID);
     172    my $has_image_type = 0;
     173
     174    my @image_type_split = split(/%/,$self->{'imageType'});
     175    my @image_type_ext = map { "($_)" } @image_type_split;
     176    my $image_type_re = join("|",@image_type_ext);
     177    $image_type_re =~ s/\./\\\./g;
     178
     179    my $assoc_files = $doc_obj->{'associated_files'};
     180
     181    foreach my $af ( @$assoc_files ) {
     182    my ($real_filename, $assoc_filename, $mime_type, $section) = @$af;
     183    if ($assoc_filename =~ m/$image_type_re/) {
     184        $has_image_type = 1;
     185        last;
     186    }
     187    }
     188
     189    if ($has_image_type) {
     190    my $doc_OID = $doc_obj->get_OID();
     191    push (@{$self->{'list'}}, $doc_OID);
     192    }
     193
    174194}
    175195
Note: See TracChangeset for help on using the changeset viewer.