Evo Inflector implements English pluralization algorithm based on Damian Conway's paper "An Algorithmic Approach to English Pluralization".
The tests performed (May 2014) based on data from Wiktionary show that:
- for entire set of 163518 words from Wiktionary, Evo Inflector returns correct answer for 68.4% of them,
- for 979 words marked as basic words almost all answers are correct, the sole exception being the word 'worse' which when used as a noun does not have a plural form,
- for 24.9% of all words Evo Inflector returns some form, but the word is marked as uncountable in Wiktionary,
- for 4.1% of all words Wiktionary does not specify the plural form for given word so whatever Evo Inflector returns will always be wrong,
- for 2.6% Evo Inflector returns an answer which is different than the one provided in Wiktionary.
(If you are curious this test is part of the unit tests.)
- 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
1.0 Initial revision
System.out.println(English.plural("word")); // == "words" System.out.println(English.plural("word", 1)); // == "word" System.out.println(English.plural("word", 2)); // == "words"
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.2.2</version> </dependency>