Lingua-EN-Inflect-Number reviews

cpanratings
 

RSS | Module Info | Add a review of Lingua-EN-Inflect-Number

Lingua-EN-Inflect-Number (1.1) *

This module is supposed to turn English nouns from plural to singular. However, the whole module is based on a mistake: it actually uses Lingua::EN::Inflect's method for turning a third person singular verb (he does, she likes, it eats) into a plain verb (I do, you like, they eat). The source code actually contains a comment "I don't know why this works, but it seems to." But unfortunately it doesn't; the most simple examples of irregular plurals are completely unhandled by this module:

input:

--------------

use warnings;
use strict;
use Test::More;
use Lingua::EN::Inflect::Number 'to_S';

my %words = qw/
bogus bogus
citrus citrus
menus menu
species species
flies fly
monkeys monkey
children child
women woman
mice mouse
/;

for my $word (sort keys %words) {

my $s = to_S ($word);

ok ($s eq $words{$word}, "$s == $words{$word}");
}
done_testing;

-------------

output:

--------------

ok 1 - bogus == bogus
not ok 2 - children == child
# Failed test 'children == child'
# at ./lingua-en-inflect-numbers.pl line 21.
ok 3 - citrus == citrus
ok 4 - fly == fly
not ok 5 - menus == menu
# Failed test 'menus == menu'
# at ./lingua-en-inflect-numbers.pl line 21.
not ok 6 - mice == mouse
# Failed test 'mice == mouse'
# at ./lingua-en-inflect-numbers.pl line 21.
ok 7 - monkey == monkey
ok 8 - species == species
not ok 9 - women == woman
# Failed test 'women == woman'
# at ./lingua-en-inflect-numbers.pl line 21.
1..9
# Looks like you failed 4 tests of 9.

-----------

This module is inadequate for turning English plural nouns to singular ones, and the two other things it does are already handled by Lingua::EN::Inflect.