Hi herveus,

++ on the point that there is no general solution to this problem but I thought I would just check out how Lingua::EN::NameCase would deal with your examples...

#perl -w use strict; use warnings; use Lingua::EN::NameCase qw( NameCase nc ) ; my @proper_names = ( 'Owen ap Tudor', 'Sveinn inn Danska', 'David ben Jesse' ); my @lowercase_names = map { lc } @proper_names ; my @result = NameCase( @lowercase_names ) ; my ($iCount, $bMatch); for ($iCount = 0; $iCount <= $#result; $iCount++) { $bMatch = $proper_names[$iCount] eq $result[$iCount] ? 'Y' : 'N'; write; } exit; format STDOUT_TOP = Orignal case Output from NameCase Match ============================== ============================== ===== . format STDOUT = @<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<< $proper_names[$iCount], $result[$iCount], $bMatch . __END__

Surprisingly the output looks like this:

Orignal case Output from NameCase Match ============================== ============================== ===== Owen ap Tudor Owen ap Tudor Y Sveinn inn Danska Sveinn Inn Danska N David ben Jesse David ben Jesse Y

"Sveinn Inn Danska" is not correct but surprisingly for a Lingua::EN module it does deal well with the other cases. Also from the documentation there is a variable that can be set to deal with special cases for Spanish... Perhaps the module itself has evolved to become a misnomer.

Regards,
Dom.

Update: Corrected typo on link.
Update: Corrected typo on incorrect name.


In reply to Re: Re: Re: Correct case by dbush
in thread Correct case by stew

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.