Create plural form of a noun?

I’m using: SWI-Prolog version 8.0.2.

Is there a library or package that can take a noun and give me the plural form of the noun?

I have never done this but this query might prove useful

Google: online dictionary api

Thanks, but I already have a full package for that, but it’s in another process. I was hoping there was something native to SWI-Prolog or a library for it so I didn’t have to jump processes. Guess I’ll have to.

Maybe not. There are many people here who know a lot and might know the answer. Don’t be surprised if a better answer turns up in few days or more. I though WordNet might do it, but sadly it doesn’t.

1 Like

Sadly WordNet doesn’t provide inflection operations in reverse, and admits it’s own reduction from plural to singular is a little dodgy. But WordNet do provide us with a huge list of nouns and there are other NLP tools out there that can pluralize words.

So I used one in conjunction with WordNet and generated a Prolog database of inflection/2 predicates of the form:

%! inflection(Singular, Plural)
inflection(entity, entities).

You can download the version with atoms, or get the whole generating procedure along with WordNet from my GitLab. I hope it’s useful for you, look-ups in a local (indexed) database should be the quickest way to do this task, and likely the most appropriate given the variation in the English language. Any spotted mistakes can easily be corrected and rule based systems are known to be buggy, so there may be a few hiding in there.

Thinking about it, I also added a noun_inflection_module.pl which doesn’t store the data items for nouns that pluralize just by adding an “s”. If I were more of a linguist I might also be able to do “just adding an ‘es’ on the end”. The thinking on this is that it reduces the number of facts to maintain. There are down-sides too, such as no-longer being able to call inflection(SingularVar, PluralVar) and get anything but the first exception case, at least as it’s currently implemented. Think I’d still opt for the whole database, but it’s worth examining the options.

Last edit, just fixed the syntax error! :blush:

2 Likes

Hi Paul,

There’s no license on that project:

**No license. All rights reserved**

WordNet is released under a license similar to the MIT one, I’ve included that and said my modifications are under MIT so feel free to use it.

I’m not an expert on licenses so am unsure if I’ve done this correctly with a license for modifications or if the modifications are covered by the original?! Also, WordNet didn’t bother to update their license between 3.0 and 3.1, so their license might not apply to 3.1? Such a mess… Think I’m starting to become a fan of the “WTFPL” license!

What I really want is a “Take this project off my hands and please do it better than me PL”!

Hi Paul,

Perhaps this helps?:

https://help.github.com/en/articles/licensing-a-repository

1 Like