atteo / evo-inflector

Singular to plural english word converter
Apache License 2.0
341 stars 44 forks source link

SWUbanner

Build Status Coverage Status Maven Central

About

Evo Inflector implements English pluralization algorithm based on "Damian Conway's" paper "An Algorithmic Approach to English Pluralization".

There are more or less half a million downloads of Evo Inflector from Maven Central each month. It is used by many high profile projects like Spring and JetBrains and tons of smaller projects.

Usage

The usage is pretty simple:

English.plural("word") == "words"

Additionaly you can use provide a required count to select singular or plural form automatically:

English.plural("foot", 1)) == "foot"
English.plural("foot", 2)) == "feet"

Features

The algorithm tries to preserve the capitalization of the original word, for instance:

English.plural("NightWolf") == "NightWolves"

Limitations:

Tests

As part of the unit tests the results of the algorithm are compared with data from Wiktionary.

There are (2021-07-10) 276574 single word english nouns in the English Wiktionary of which:

Evo Inflector returns correct answer for:

In overall it returns correct answer for 69.02782% (190913) of all nouns.

Changes

1.3

1.2.2

1.2

1.1

1.0.1

1.0 Initial revision

License

Evo Inflector is available under Apache License 2.0.

Download

You can download the library from here or use the following Maven dependency:

<dependency>
    <groupId>org.atteo</groupId>
    <artifactId>evo-inflector</artifactId>
    <version>1.3</version>
</dependency>

or the Gradle dependency:

compile group: 'org.atteo', name: 'evo-inflector', version: '1.2.2'