Skip Menu |

This queue is for tickets about the Rose-DB-Object CPAN distribution.

Report information
The Basics
Id: 61573
Status: resolved
Priority: 0/
Queue: Rose-DB-Object

People
Owner: Nobody in particular
Requestors: quinn [...] fairpath.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.789
Fixed in: (no value)



Subject: Convention manager thinks the singular of "doses" is "dos"
I have a table called doses, resulting in classes named ::Dos, ::Dos::Manager, et cetera. Since it has a number of foreign keys, hand-editing the output of Rose::DB::Object::Loader's make_modules methods takes some time. Here's the offending code from Rose::DB::Object::ConventionManager: return $word if($word =~ s/ses$/s/i); IMO the fix would be to change the default convention manager so that it uses one of the Lingua:: modules to have an intelligent dictionary of singulars and plurals. I don't know if you agree with this approach; perhaps you prefer the minimalist approach here. Anyway, in the meantime, I guess I'll figure out how to write a custom convention manager. Thanks,
The default convention manager's singular/plural conversion rules are intentionally simply. There's an example in the documentation that shows how to use Lingua::EN::Inflect to get improved behavior, but I don't want to make this module a prerequisite. http://search.cpan.org/dist/Rose-DB- Object/lib/Rose/DB/Object/ConventionManager.pm#TIPS_AND_TRICKS
Subject: Re: [rt.cpan.org #61573] Convention manager thinks the singular of "doses" is "dos"
Date: Wed, 22 Sep 2010 15:23:46 -0700
To: bug-Rose-DB-Object [...] rt.cpan.org
From: Quinn Weaver <quinn [...] fairpath.com>
On Wed, Sep 22, 2010 at 2:56 PM, John Siracusa via RT <bug-Rose-DB-Object@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=61573 > > > The default convention manager's singular/plural conversion rules are intentionally simply. > There's an example in the documentation that shows how to use Lingua::EN::Inflect to get > improved behavior, but I don't want to make this module a prerequisite. > > http://search.cpan.org/dist/Rose-DB- > Object/lib/Rose/DB/Object/ConventionManager.pm#TIPS_AND_TRICKS >
Thanks for the super-fast reply. I'm now trying to figure out what to use for plural_to_singular_function() ; any recommendations? Seems like Lingua::EN::Inflect provides only pluralization, not singularization. -- Quinn Weaver Consulting, LLC Full-stack web design and development http://quinnweaver.com/ 510-520-5217
On Wed Sep 22 18:24:17 2010, QUINN wrote: Show quoted text
> Thanks for the super-fast reply. I'm now trying to figure out what to > use for plural_to_singular_function() ; any recommendations? Seems > like Lingua::EN::Inflect provides only pluralization, not > singularization.
Maybe to_S() in Lingua::EN::Inflect::Number? http://search.cpan.org/~simon/Lingua-EN-Inflect-Number-1.1/Number.pm#to_S_/_to_PL