Changeset 1706 for trunk/gsdl/perllib


Ignore:
Timestamp:
2000-11-27T15:37:22+13:00 (24 years ago)
Author:
say1
Message:

cleaned up the Title code to strip away standard prefixes inserted by MSWord etc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/PSPlug.pm

    r1700 r1706  
    9494    if ($self->{'extract_title'} && !$title_found) {
    9595        foreach my $word ($line =~ m|Title: ([-A-Za-z0-9@/\/\(\):,. ]*)|g) {
    96         if ($word ne "") {
    97             $doc->add_utf8_metadata($section, "Title", $word );
    98             print "\"$word\" ===>>> \"Title\" = \"$word\"\n";
     96        my $new_word = $word;
     97        $new_word =~ s/\(Untitled\)//i;
     98        $new_word =~ s/\(Microsoft Word\)//i;
     99        $new_word =~ s/Microsoft Word//i;
     100        $new_word =~ s/^\(//i;
     101        $new_word =~ s/\)$//i;
     102        $new_word =~ s/^ - //i;
     103        if ($new_word ne "") {
     104            $doc->add_utf8_metadata($section, "Title", $new_word );
     105            print "\"Title\" = \"$new_word\"\n";
    99106            $title_found = 1;
    100107        }
Note: See TracChangeset for help on using the changeset viewer.