.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .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" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "NameCase 3pm" .TH NameCase 3pm "2008-02-26" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" NameCase \- Perl module to fix the case of people's names. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # Working with scalars; complementing lc and uc. .Ve .PP .Vb 1 \& use Lingua::EN::NameCase qw( nc ) ; .Ve .PP .Vb 1 \& $FixedCasedName = nc( $OriginalName ) ; .Ve .PP .Vb 1 \& $FixedCasedName = nc( \e$OriginalName ) ; .Ve .PP .Vb 1 \& # Working with arrays or array references. .Ve .PP .Vb 1 \& use Lingua::EN::NameCase \(aqNameCase\(aq ; .Ve .PP .Vb 2 \& $FixedCasedName = NameCase( $OriginalName ) ; \& @FixedCasedNames = NameCase( @OriginalNames ) ; .Ve .PP .Vb 2 \& $FixedCasedName = NameCase( \e$OriginalName ) ; \& @FixedCasedNames = NameCase( \e@OriginalNames ) ; .Ve .PP .Vb 1 \& NameCase( \e@OriginalNames ) ; # In\-place. .Ve .PP .Vb 2 \& # NameCase will not change a scalar in\-place, i.e. \& NameCase( \e$OriginalName ) ; # WRONG: null operation. .Ve .PP .Vb 3 \& $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. .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: Mc, Mac, al, el, ap, da, de, delle, della, di, du, del, der, la, le, lo, van and von. .PP It correctly deals with names which contain apostrophies and hyphens too. .Sh "\s-1EXAMPLE\s0 \s-1FIXES\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 .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 NameParse.pm for any really sophisticated name parsing. .SH "CHANGES" .IX Header "CHANGES" 1998/04/20 First release. .PP 1998/06/25 First public release. .PP 1999/01/18 Second public release. .PP 1999/02/08 Added Mac with Mack as an exception, thanks to Kim Ryan for this. .PP 1999/05/05 Copied Kim Ryan's Mc/Mac solution from his NameParse.pm and replaced my Mc/Mac solution with his. .PP 1999/05/08 nc can now use \f(CW$_\fR as its default argument e.g. \*(L"$ans = nc ;\*(R" and \*(L"nc ;\*(R", both of which set \f(CW$_\fR, with the first one setting \f(CW$ans\fR also. .PP 1999/07/30 Modified for \s-1CPAN\s0 and automatic testing. Stopped using \f(CW$_\fR as the default argument. .PP 1999/08/08 Changed licence to \s-1LGPL\s0. .PP 1999/09/07 Minor change to packaging for \s-1CPAN\s0. .PP 1999/09/09 Renamed package Lingua::EN::NameCase.pm as per John Porter's (\s-1CPAN\s0) suggestion. .PP 1999/11/13 Added code for names with roman numerals, thanks to David Lynn Rice for this suggestion. (If you need to go beyond \s-1LXXXIX\s0 let me know.) .PP 2000/11/22 Added use locale at the suggestion of Eric Kolve. It should have been there in the first place. .PP 2002/04/25 Al, Ben and Van are preserved if single names and namecased otherwise, e.g. 'Al' => 'Al', 'Al Fahd' => 'al Fahd'. Added \f(CW$SPANISH_EL\fR variable. All thanks to a suggestion by Aaron Patterson. 2002/04/26 Changed \f(CW$SPANISH_EL\fR to \f(CW$SPANISH\fR and now 'La' => 'la' unless \f(CW$SPANISH\fR is set in which case 'La' => 'La'. Again thanks to Aaron Patterson. .PP 2007/04/27 Added 16 \*(L"Mac\*(R" exceptions provided by Stuart McConnachie. The license is now \*(L"the same terms as Perl itself\*(R". .PP 2008/02/07 Fixed the version number. .SH "AUTHOR" .IX Header "AUTHOR" Mark Summerfield. I can be contacted as \- please include the word 'namecase' in the subject line. .PP Thanks to Kim Ryan for his Mc/Mac solution. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) Mark Summerfield 1998\-2008. All Rights Reserved. .PP This module may be used/distributed/modified under the same terms as Perl itself.