Skip Menu |

This queue is for tickets about the Lingua-EN-Inflect CPAN distribution.

Report information
The Basics
Id: 129333
Status: resolved
Priority: 0/
Queue: Lingua-EN-Inflect

People
Owner: Nobody in particular
Requestors: ALEENA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Cyclops and Fury return incorrect plurals, and html gets in the way of getting indefinite articles
Hello Damien, How are things? Cyclops returns cyclopss instead of cyclopses, and Fury returns Furys instead of Furies. And I found that values inside html tags won't return the indefinite article I want. A(<a href="indefinite_term.html">indefinite term</a>) does not return "an <a href="indefinite_term.html">indefinite term</a>", so I have to get the indefinite article for the indefinite term, then split it off when I do not want the indefinite article inside the link. my $indefinite = A(indefinite term); my ($article, $term) = split(/ /, $indefinite, 2); my $text = qq($article <a href="indefinite_term.html">$term</a>); Am I missing something, or is that the way it is? Thanks for reading, Lady Aleena
ACK! I misspelled your name, sorry Damian. - LA On Sat Apr 27 07:03:48 2019, ALEENA wrote: Show quoted text
> Hello Damien, > > How are things? > > Cyclops returns cyclopss instead of cyclopses, and Fury returns Furys > instead of Furies. > > And I found that values inside html tags won't return the indefinite > article I want. > > A(<a href="indefinite_term.html">indefinite term</a>) does not return > "an <a href="indefinite_term.html">indefinite term</a>", so I have to > get the indefinite article for the indefinite term, then split it off > when I do not want the indefinite article inside the link. > > my $indefinite = A(indefinite term); > my ($article, $term) = split(/ /, $indefinite, 2); > my $text = qq($article <a href="indefinite_term.html">$term</a>); > > Am I missing something, or is that the way it is? > > Thanks for reading, > Lady Aleena
Subject: Re: [rt.cpan.org #129333] Cyclops and Fury return incorrect plurals, and html gets in the way of getting indefinite articles
Date: Sat, 27 Apr 2019 12:17:29 +0000
To: bug-Lingua-EN-Inflect [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Greetings, Milady. Show quoted text
> How are things?
Well, I thank you. And I hope things are likewise with you. Show quoted text
> Cyclops returns cyclopss instead of cyclopses,
Corrected in the new version that I just uploaded to CPAN. Show quoted text
> and Fury returns Furys instead of Furies.
This is falling foul of the heuristic that capitalized words are names, so in 'classical' mode, it just adds a -s. The workaround is either not to use classical mode for names: classical(names=>0); say PL_N('Fury'); or to inflect the word case-insensitively: say ucfirst( PL_N( lc( 'Fury' ))) or to use Lingua::EN::Inflexion instead: say noun('Fury')->plural; Show quoted text
> And I found that values inside html tags won't return the indefinite
article I want. Show quoted text
> > A(<a href="indefinite_term.html">indefinite term</a>) does not return "an
<a href="indefinite_term.html">indefinite term</a>", so I have to get the indefinite article for the indefinite term, then split it off when I do not want the indefinite article inside the link. Show quoted text
> Am I missing something, or is that the way it is?
No, you're not missing anything. That is indeed just the way it is. A() and AN() have no understanding of HTML...or any other markup notation. They simply strip any leading "a" or "an" then attempt to select the right article from whatever comes next (in your case, the opening '<') Unfortunately, not even Lingua::EN::Inflexion will help you here. :-( Your current solution is the only one. Thanks for the reports and for your continued interest in the module. I should probably point out, though, that it is likely that I will be discontinuing support for Lingua::EN::Inflect, in favour of Lingua::EN::Inflexion, within the next year or two. All the very best, Damian
Damian, As long as my ISP refuses to walk away from CPanel, I am forced to use Lingua::EN::Inflect because CPanel refuses to upgrade its Perl version to anything past 5.8.8, so I can't use Lingua::EN::Inflexion. I am glad all is well, have a nice day! Lady Aleena On Sat Apr 27 08:18:17 2019, damian@conway.org wrote: Show quoted text
> Greetings, Milady. >
> > How are things?
> > Well, I thank you. > And I hope things are likewise with you. > >
> > Cyclops returns cyclopss instead of cyclopses,
> > Corrected in the new version that I just uploaded to CPAN. > >
> > and Fury returns Furys instead of Furies.
> > This is falling foul of the heuristic that capitalized words > are names, so in 'classical' mode, it just adds a -s. > The workaround is either not to use classical mode for names: > > classical(names=>0); > say PL_N('Fury'); > > or to inflect the word case-insensitively: > > say ucfirst( PL_N( lc( 'Fury' ))) > > or to use Lingua::EN::Inflexion instead: > > say noun('Fury')->plural; > >
> > And I found that values inside html tags won't return the indefinite
> article I want.
> > > > A(<a href="indefinite_term.html">indefinite term</a>) does not return "an
> <a href="indefinite_term.html">indefinite term</a>", so I have to get the > indefinite article for the indefinite term, then split it off when I do not > want the indefinite article inside the link.
> > Am I missing something, or is that the way it is?
> > No, you're not missing anything. That is indeed just the way it is. > > A() and AN() have no understanding of HTML...or any other markup notation. > They simply strip any leading "a" or "an" then attempt to select the right > article from whatever comes next (in your case, the opening '<') > > Unfortunately, not even Lingua::EN::Inflexion will help you here. :-( > Your current solution is the only one. > > > Thanks for the reports and for your continued interest in the module. > I should probably point out, though, that it is likely that I will be > discontinuing support for Lingua::EN::Inflect, in favour of > Lingua::EN::Inflexion, within the next year or two. > > > All the very best, > > Damian