Skip to content

tchemit/evo-inflector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • 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</version>
</dependency>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published