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.
The usage is pretty simple:
English.plural("word") == "words"Additionally you can use provide a required count to select singular or plural form automatically:
English.plural("foot", 1)) == "foot"
English.plural("foot", 2)) == "feet"The algorithm tries to preserve the capitalization of the original word, for instance:
English.plural("NightWolf") == "NightWolves"- The algorithm cannot reliably detect uncountable words. It will pluralize them anyway.
- There are words which have the same singular form and multiple plural forms, ex: die (plural dies) - The cubical part of a pedestal; a plinth. die (plural dice) - An isohedral polyhedron, usually a cube
As part of the unit tests the results of the algorithm are compared with data from Wiktionary. Wiktionary is not a perfect source of data, especially for more obscure words, but it is the best we have.
There are (2026-03-10) 345105 single word nouns in the English Wiktionary of which:
- 68.427% (236145) are countable nouns,
- 28.260384% (97528) are uncountable nouns,
- for 2.9802525% (10285) nouns plural is unknown,
- for 0.33236262% (1147) nouns plural is not attested.
Evo Inflector returns correct answer for:
- 94.61559% (223430) of all countable nouns, see
target/reports/incorrect-countable.md, - but only for 8.041793% (7843) of uncountable nouns.
In overall it returns correct answer for 67.01526% (231273) of all nouns.
- rewrite internals around a compiled suffix-matching engine instead of repeated regex and rule-list scans
- remove the old regexp-based engine and benchmark-only legacy copy
- require JDK 17 for the main build
- simplify and modernize rule handling while keeping the public
English.plural(...)API - add JMH benchmarks for anglicized and classical compiled modes
- improve throughput substantially; the compiled engine delivered about 18x faster mixed-dataset throughput, about 54x faster repeated lowercase lookups, and about 27x faster repeated mixed-case lookups versus the old regexp engine during the migration benchmarks
- fix ulum -> ula rule
- return empty string for empty string input
- improve preservation of letter capitalization
- make tests up-to-date with change in Wiktionary
- fix pluralization of todo
- compile with Java 1.6 for better compatibility
- -s -> -ses, for instance pancreas -> pancrases
- -ulum -> -ula, for instance baculum -> bacula
- some minor optimizations
- better testing with Wiktionary dump
- fix for -us ending words, like virus
- add inflection with count
Evo Inflector is available under Apache License 2.0.
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'