.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Lingua::EN::NameCase 3pm" .TH Lingua::EN::NameCase 3pm "2022-10-22" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Lingua::EN::NameCase \- Correctly case a person's name from UPERCASE or lowcase .SH "VERSION" .IX Header "VERSION" Version 1.21 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # Working with scalars; complementing lc and uc. \& \& use Lingua::EN::NameCase qw( nc ); \& \& $FixedCasedName = nc( $OriginalName ); \& \& $FixedCasedName = nc( \e$OriginalName ); \& \& # Working with arrays or array references. \& \& use Lingua::EN::NameCase \*(AqNameCase\*(Aq; \& \& $FixedCasedName = NameCase( $OriginalName ); \& @FixedCasedNames = NameCase( @OriginalNames ); \& \& $FixedCasedName = NameCase( \e$OriginalName ); \& @FixedCasedNames = NameCase( \e@OriginalNames ); \& \& NameCase( \e@OriginalNames ) ; # In\-place. \& \& # NameCase will not change a scalar in\-place, i.e. \& NameCase( \e$OriginalName ) ; # WRONG: null operation. \& \& $Lingua::EN::NameCase::SPANISH = 1; \& # Now \*(AqEl\*(Aq => \*(AqEl\*(Aq instead of (default) Greek \*(AqEl\*(Aq => \*(Aqel\*(Aq. \& # Now \*(AqLa\*(Aq => \*(AqLa\*(Aq instead of (default) French \*(AqLa\*(Aq => \*(Aqla\*(Aq. \& \& $Lingua::EN::NameCase::HEBREW = 0; \& # Now \*(AqAharon BEN Amram Ha\-Kohein\*(Aq => \*(AqAharon Ben Amram Ha\-Kohein\*(Aq \& # instead of (default) => \*(AqAharon ben Amram Ha\-Kohein\*(Aq. \& \& $Lingua::EN::NameCase::ROMAN = 0; \& # Now \*(AqLi\*(Aq => \*(AqLi\*(Aq instead of (default) \*(AqLi\*(Aq => \*(AqLI\*(Aq. \& \& $Lingua::EN::NameCase::POSTNOMINAL = 0; \& # Now \*(AqPHD\*(Aq => \*(AqPhD\*(Aq instead of (default) \*(AqPHD\*(Aq => \*(AqPhd\*(Aq. .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Forenames and surnames are often stored either wholly in \s-1UPPERCASE\s0 or wholly in lowercase. This module allows you to convert names into the correct case where possible. .PP Although forenames and surnames are normally stored separately if they do appear in a single string, whitespace separated, NameCase and nc deal correctly with them. .PP NameCase currently correctly name cases names which include any of the following: .PP .Vb 2 \& Mc, Mac, al, el, ap, da, de, delle, della, di, du, del, der, \& la, le, lo, van and von. .Ve .PP It correctly deals with names which contain apostrophes and hyphens too. .SS "\s-1EXAMPLE FIXES\s0" .IX Subsection "EXAMPLE FIXES" .Vb 7 \& Original Name Case \& \-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\- \& KEITH Keith \& LEIGH\-WILLIAMS Leigh\-Williams \& MCCARTHY McCarthy \& O\*(AqCALLAGHAN O\*(AqCallaghan \& ST. JOHN St. John .Ve .PP plus \*(L"son (daughter) of\*(R" etc. in various languages, e.g.: .PP .Vb 4 \& VON STREIT von Streit \& VAN DYKE van Dyke \& AP LLWYD DAFYDD ap Llwyd Dafydd \& etc. .Ve .PP plus names with roman numerals (up to 89, \s-1LXXXIX\s0), e.g.: .PP .Vb 2 \& henry viii Henry VIII \& louis xiv Louis XIV .Ve .SS "NameCase" .IX Subsection "NameCase" Takes a scalar, scalarref, array or arrayref, and changes the case of the contents, as appropriate. Essentially a wrapper around \fBnc()\fR. .SS "nc" .IX Subsection "nc" Takes a scalar or scalarref, and change the case of the name in the corresponding string appropriately. .SH "BUGS" .IX Header "BUGS" The module covers the rules that I know of. There are probably a lot more rules, exceptions etc. for \*(L"Western\*(R"\-style languages which could be incorporated. .PP There are probably lots of exceptions and problems \- but as a general data 'cleaner' it may be all you need. .PP Use Kim Ryan's Lingua::EN::NameParse for any really sophisticated name parsing. .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc Lingua::EN::NameCase .Ve .PP You can also look for information at: .IP "\(bu" 4 MetaCPAN .Sp .IP "\(bu" 4 \&\s-1RT: CPAN\s0's request tracker .Sp .IP "\(bu" 4 \&\s-1CPANTS\s0 .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Testers' Matrix .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Ratings .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Testers Dependencies .Sp .SH "AUTHOR" .IX Header "AUTHOR" .Vb 2 \& 1998\-2014 Mark Summerfield \& 2014\-present Barbie \& \& 2020\- Maintained by Nigel Horne, C<< >> .Ve .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Thanks to Kim Ryan for his Mc/Mac solution. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) Mark Summerfield 1998\-2014. All Rights Reserved. Copyright (c) Barbie 2014\-2015. All Rights Reserved. .PP This distribution is free software; you can redistribute it and/or modify it under the Artistic Licence v2.