|
NAMETemplate::Plugin::Lingua::EN::Inflect - Interface to Lingua::EN::Inflect moduleSYNOPSIS[% USE infl = Lingua.EN.Inflect; -%] [% FILTER inflect(number => 42); -%] There PL_V(was) NO(error). PL_ADJ(This) PL_N(error) PL_V(was) fatal. [% END; -%] [% "... and "; infl.ORD(9); "ly..." %] # Output: # There were 42 errors. # These errors were fatal. # ... and 9thly... DESCRIPTIONThe Lingua::EN::Inflect is an interface to Damian Conway's Linua::EN::Inflect Perl module, which provides plural inflections, "a"/"an" selection for English words, and manipulation of numbers as words.The plugin provides an 'inflect' filter, which can be used to interpolate inflections in a string. The NUM() function sets a persistent default value to be used whenever an optional number argument is omitted. The number to be used for a particular invocation of 'inflect' can also be specified with a 'number' option. For the full gory details of the inflection functionality refer to the Lingua::EN::Inflect manual. OBJECT METHODS
INTERNAL METHODS
TODOFinish off documenting the object methods.Provide tests for all methods in the test suite. It would also be nice to have methods that spelled out numbers that were less than a certain threshold and that formatted large numbers with commas, for example: inflect("There PL_V(was) NO(error).", number => 0); # outputs: "There were no errors." inflect("There PL_V(was) NO(error).", number => 1); # outputs: "There was one errors." inflect("There PL_V(was) NO(error).", number => 3); # outputs: "There were three errors." inflect("There PL_V(was) NO(error).", number => 1042); # outputs: "There were 1,042 errors." This would require changes to the Lingua::EN::Inflect module. SEE ALSOLingua::EN::Inflect, Template, "Template::Plugin"DEDICATIONThis distribution was originally created by Andrew Ford. Sadly in early 2014, Andrew was diagnosed with Pancreatic Cancer and passed away peacfully at home on 25th April 2014.One of his wishes was for his OpenSource work to continue. At his funeral, many of his colleagues and friends, spoke of how he felt like a person of the world, and how he embrace the idea of OpenSource being for the benefit of the world. Anyone wishing to donate in memory of Andrew, please consider the following charities:
AUTHOROriginal Author: Andrew Ford 2005-2014 Current Maintainer: Barbie <barbie@cpan.org> 2014 ACKNOWLEDGEMENTSAndrew Ford wrote the original plugin code (basing it heavily on the Template::Plugin::Autoformat code).Damian Conway <damian@conway.org> wrote the Lingua::EN::Inflect module, which does all the clever stuff. COPYRIGHT & LICENSECopyright (C) 2005-2014 Andrew Ford Copyright (C) 2014-2015 Barbie for Miss Barbell Productions.This distribution is free software; you can redistribute it and/or modify it under the Artistic Licence v2.
Visit the GSP FreeBSD Man Page Interface. |