On Fri, 21 Dec 2007 20:39:18 -0500 Adam Prime <[EMAIL PROTECTED]> wrote: 

AP> I'm not sure if this will help, but i had a similar sort of problem with 
AP> a table called 'Category'.  this is my loader (which works).  I can't 
AP> remember where this is originally sourced from unfortunately (but i 
AP> would suspect the list archives)

AP> this is my DB::Metadata.pm

AP> package EatLocal::DB::Metadata;

AP> use Rose::DB::Object::Metadata;
AP> our @ISA = qw(Rose::DB::Object::Metadata);

AP> use Lingua::EN::Inflect::Number;

AP> sub init_convention_manager {
AP>      my $self = shift;

AP>      my $cm = $self->SUPER::init_convention_manager(@_);

AP>      $cm->singular_to_plural_function(\&Lingua::EN::Inflect::Number::to_PL);
AP>      $cm->plural_to_singular_function(\&Lingua::EN::Inflect::Number::to_S);
AP>      return $cm;
AP> }

AP> 1;

This should definitely go in the docs, thanks for pointing me to the
right module!  I looked on CPAN for 'singular', FWIW, but didn't find
this one.

Here's my current plural_to_singular setup:

 $cm->plural_to_singular_function(sub
                                  {
                                   my $word = shift @_;
                                   return $word if $word eq 'fortis'; # the one 
exception
                                   return 
Lingua::EN::Inflect::Number::to_S($word);
                                  });

Thanks
Ted

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to