Skip to content
Singular to plural english word converter
Java Shell
Branch: master
Clone or download

Latest commit

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Added missing $ to regex. (#18) Sep 12, 2018
.gitignore Adjust POM configuration Sep 8, 2012
.travis.yml Switch to OpenJDK 8 due to issue in Travis Aug 4, 2018
LICENSE Fix wiktionary dump parsing Apr 29, 2014
README.md Update README.md (#16) Aug 3, 2018
pom.xml Sort the POM file correctly Dec 20, 2016

README.md

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".

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.)

Changes

1.2.2

  • fix pluralization of todo

1.2

  • 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

1.1

  • fix for -us ending words, like virus

1.0.1

  • add inflection with count

1.0 Initial revision

Usage

System.out.println(English.plural("word")); // == "words"

System.out.println(English.plural("word", 1)); // == "word"
System.out.println(English.plural("word", 2)); // == "words"

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.2.2</version>
</dependency>

or the Gradle dependency:

compile group: 'org.atteo', name: 'evo-inflector', version: '1.2.2'
You can’t perform that action at this time.