Skip Menu |

This queue is for tickets about the Lingua-EN-NameCase CPAN distribution.

Report information
The Basics
Id: 47708
Status: resolved
Priority: 0/
Queue: Lingua-EN-NameCase

People
Owner: BARBIE [...] cpan.org
Requestors: bitcard [...] doesntsuck.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 1.11
  • 1.12
  • 1.13
  • 1.14
  • 1.15
Fixed in: 1.17



Subject: Suffix that should be uppercased (MD) is titlecased (Md)
Names with suffixes, such as the doctory suffix 'MD' do not appear to be handled at all. This patch uppercases 'MD' against 1.15
Subject: suffix1.patch
--- NameCase.pm 2009-07-08 12:21:05.000000000 -0400 +++ NameCase.pm 2009-07-08 12:09:46.000000000 -0400 @@ -126,6 +126,9 @@ s{ \b ( (?: [Xx]{1,3} | [Xx][Ll] | [Ll][Xx]{0,3} )? (?: [Ii]{1,3} | [Ii][VvXx] | [Vv][Ii]{0,3} )? ) \b }{\U$1}gox ; + # Uppercase suffixes + s{ \b (Md) $ }{\U$1}ox; + $_ ; }
Subject: Re: [rt.cpan.org #47708] Suffix that should be uppercased (MD) is titlecased (Md)
Date: Thu, 9 Jul 2009 06:53:30 +0100
To: bug-Lingua-EN-NameCase [...] rt.cpan.org
From: Mark Summerfield <mark [...] qtrac.eu>
On 2009-07-08, Dave Gray via RT wrote: Show quoted text
> Wed Jul 08 12:33:01 2009: Request 47708 was acted upon. > Transaction: Ticket created by yargevad > Queue: Lingua-EN-NameCase > Subject: Suffix that should be uppercased (MD) is titlecased (Md) > Broken in: 1.11, 1.12, 1.13, 1.14, 1.15 > Severity: Normal > Owner: Nobody > Requestors: bitcard@doesntsuck.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=47708 > > > > Names with suffixes, such as the doctory suffix 'MD' do not appear to be > handled at all. This patch uppercases 'MD' against 1.15
The patch looks wrong to me. Instead of s{ \b (Md) $ }{\U$1}ox; should't it be s{ \b ([Mm][Dd]) $ }{\U$1}ox; And if you're doing suffixes, why not do these instead: s{ \b ([Mm][DdAa] $}{\U$1}ox; # MD, MA s{ \b ([Pp][Hh][Dd] $}{PhD}ox; # PhD Anyway, just some ideas:-) -- Mark Summerfield, Qtrac Ltd, www.qtrac.eu C++, Python, Qt, PyQt - training and consultancy "Programming in Python 3" - ISBN 0137129297
CC: bitcard [...] doesntsuck.com
Subject: Re: [rt.cpan.org #47708] Suffix that should be uppercased (MD) is titlecased (Md)
Date: Thu, 9 Jul 2009 08:43:03 -0600
To: bug-Lingua-EN-NameCase [...] rt.cpan.org
From: Dave Gray <yargevad [...] gmail.com>
Hi Mark, On Wed, Jul 8, 2009 at 11:53 PM, Mark Summerfield via RT<bug-Lingua-EN-NameCase@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=47708 > > > On 2009-07-08, Dave Gray via RT wrote:
>> Wed Jul 08 12:33:01 2009: Request 47708 was acted upon. >> Transaction: Ticket created by yargevad >>        Queue: Lingua-EN-NameCase >>      Subject: Suffix that should be uppercased (MD) is titlecased (Md) >>    Broken in: 1.11, 1.12, 1.13, 1.14, 1.15 >>     Severity: Normal >>        Owner: Nobody >>   Requestors: bitcard@doesntsuck.com >>       Status: new >>  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=47708 > >> >> >> Names with suffixes, such as the doctory suffix 'MD' do not appear to be >> handled at all. This patch uppercases 'MD' against 1.15
> > The patch looks wrong to me. > > Instead of >    s{ \b (Md) $ }{\U$1}ox; > should't it be >    s{ \b ([Mm][Dd]) $ }{\U$1}ox;
That happens after the initial title-casing, and plain old 'Md' worked in my testing. The two should be equivalent, though. Show quoted text
> And if you're doing suffixes, why not do these instead: > >    s{ \b ([Mm][DdAa] $}{\U$1}ox; # MD, MA >    s{ \b ([Pp][Hh][Dd] $}{PhD}ox; # PhD
That's a good idea, I would probably have ended up submitting a patch like that in the future anyway! Cheers, Dave
Thanks for the suggestions. I have added several that seem most frequent, but the list is by no means exhaustive. Hopefully others can help add other frequently used post-nominal initals via patches or pull requests :)