Changeset 3109


Ignore:
Timestamp:
2002-04-29T15:38:12+12:00 (22 years ago)
Author:
jrm21
Message:

When getting first char for classification, s/(.).*$/$1/g isn't good enough
as problems occur if the title is eg "Line 1\nLine 2" - we get a
"first letter" of "LLine 2" !!! Do m/
(.)/ ; $title=$1 instead, so we
are absolutely sure that the classification is only one character long.

Location:
trunk/gsdl/perllib/classify
Files:
2 edited

Legend:

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

    r2956 r3109  
    573573    $title =~ s/^\W+//g;
    574574### $title =~ s/^(\'|\`|\"|\:|\()//g; # remove any opening punctutation
    575     $title =~ s/^(.).*$/$1/;
     575
     576# only want first character for classification
     577    $title =~ m/^(.)/; $title=$1;
    576578    $title =~ tr/[a-z]/[A-Z]/;
    577579
  • trunk/gsdl/perllib/classify/AZList.pm

    r2954 r3109  
    194194
    195195    $title =~ s/^(&.{1,6};|<[^>]>|[^a-zA-Z0-9])//g; # remove any unwanted stuff
    196     $title =~ s/^(.).*$/$1/;
     196    # only need first char for classification
     197    $title =~ m/^(.)/; $title=$1;
    197198    $title =~ tr/[a-z]/[A-Z]/;
    198199    if ($title =~ /^[0-9]$/) {$title = '0-9';}
Note: See TracChangeset for help on using the changeset viewer.