Changeset 12432


Ignore:
Timestamp:
2006-08-11T12:56:10+12:00 (18 years ago)
Author:
mdewsnip
Message:

Added another case when parsing place references: if a magic word is in the first sentence.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cic-hcap/perllib/plugins/CICPlug.pm

    r12430 r12432  
    997997    &new_metadata_entry($place_doc_obj, "Reference", $place_reference);
    998998
     999    # Case 0: A magic word in the first sentence
     1000    my $place_reference_first_sentence = $place_reference;
     1001    if ($place_reference =~ /^(.*?)\./) {
     1002        $place_reference_first_sentence = $1;
     1003    }
     1004    if ($place_reference_first_sentence =~ / (collection|collections|papers|archives|database|letter|memo|inventory|photographs)\W/i) {
     1005        # Don't bother trying to parse the reference
     1006    }
    9991007    # Case 1: Author (possibly empty), then title in italics or quotes
    1000     if ($place_reference =~ /^(.*?)<i>(.*?)<\/i>/ || $place_reference =~ /^(.*)"(.*?)"/) {
     1008    elsif ($place_reference =~ /^(.*?)<i>(.*?)<\/i>/ || $place_reference =~ /^(.*)"(.*?)"/) {
    10011009        &new_metadata_entry($place_doc_obj, "ReferenceAuthor", $1);
    10021010        &new_metadata_entry($place_doc_obj, "ReferenceTitle", $2);
Note: See TracChangeset for help on using the changeset viewer.