"Karen Etheridge via RT" <bug-DBIx-Class-Schema-Loader@rt.cpan.org>
writes:
Show quoted text> I have a table called "device_criteria". Even with naming => { ALL => 'v8', force_ascii => 1 }
> in my config file, I end up with a source called DeviceCriteria, not DeviceCriterion.
>
> this looks to be the root problem:
>
> perl -MLingua::EN::Inflect::Phrase -wle'print Lingua::EN::Inflect::Phrase::to_S("device_criteria");'
> -> device_criteria
>
> I guess some splitting into words is required first?
That wouldn't help, Lingua::EN::Inflect::Phrase doesn't handle "criteria" on its own either.
$ perl -MLingua::EN::Inflect::Phrase -wle'print Lingua::EN::Inflect::Phrase::to_S("criteria");'
criteria
The underlying problem seems to be that Lingua::EN::Inflect::Number
thinks 'criteria' is already singular:
$ perl -MLingua::EN::Inflect::Number=number -E 'say number "criteria"'
s
I think this all stems from the fact hat Lingua::EN::Inflect::Number
abuses Lingua::EN::Inflect::PL() to convert to _singular_, which is
documented as "undefined (and unlikely to be correct)", the comment in
to_S() even says "I don't know why this works, but it seems to."
Lingua::EN::Inflect does know to pluralise "criterion" to "criteria",
but the usual (accidental?) behaviour of PL() singularising already-plural
words doesn't seem to apply to it (or other "ion" -> "a" words like "aphelion").
Lingua::EN::Inflect::Phrase does have a bunch of special cases, I guess this
could be added there.
-ilmari