Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Example

by Joost (Canon)
on May 06, 2002 at 12:10 UTC ( [id://164297]=note: print w/replies, xml ) Need Help??


in reply to How about Dutch Surnames?
in thread Handling caps for surnames with capitals in the middle (was: Irish Surnames)

Anyway, here's a quick hack to show the heuristic:

#!/usr/bin/perl -w use strict; for (qw(mcginley macgee develera)) { print "$_ => ".handle_caps($_)."\n"; } sub handle_caps { # this assumes irish capitalisation! my $name = ucfirst(shift); for (qw(Mc Mac)) { # always ok $name =~ s/^$_(.*)/$_\u$1/; } for (qw(De)) { # may not be followed by [aoeiu] # ?? don't know enough irish # for this rule ;-) $name =~ s/^$_([^aoeiu].*)/$_\u$1/; } return $name; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://164297]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found