Giter VIP home page Giter VIP logo

evo-inflector's Introduction

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>

evo-inflector's People

Contributors

sentinelt avatar speechkey avatar

Watchers

 avatar

Forkers

dalalsunil1986

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.