I've just written an interesting extension to Lingua::EN::Inflect, but
I can't think of a good name for it. It provides three extra functions,
number, to_PL and to_S.

These inflect a noun to its plural or to its singular form. 
Lingua::EN::Inflect, perhaps surprisingly, doesn't do this, and in fact
does interesting things if you try to PL() something that's already plural.
So, instead, we have this:

  print number("goat");  # "s" - there's only one goat
  print number("goats"); # "p" - there's several goats
  print number("sheep"); # "ambig" - there could be one or many sheep

  print to_S("goats");   # "goat"
  print to_PL("goats");  # "goats" - it already is
  print to_S("goat");    # "goat" - it already is
  print to_S("sheep");   # "sheep"

The best name I've heard so far is Lingua::EN::Inflect::Convert. Any better
suggestions? I wanted to call it Normalize but that's horrible.

Incidentally, this uses a very interesting trick to provide inheritance-like
capabilities for importing subroutines from non-OO modules. But I'll write
about that in another thread lest this one get diverted from finding me a
good name. ;)

-- 
"IT support will, from 1 October 2000, be provided by college and
departmental card locks." - J-P Stacey

Reply via email to