Skip to content

cesarferreira/kotlin-pluralizer

Repository files navigation

kotlin-pluralizer

kotlin extension to pluralize and singularize strings

Build Status Release

Show some love

GitHub followers Twitter Follow

Usage

Pluralization:

"person".pluralize()        # => "people"
"post".pluralize()          # => "posts"
"sheep".pluralize()         # => "sheep"
"foot".pluralize()          # => "feet"

Singularization:

"words".singularize()       # => "word"
"octopi".singularize()      # => "octopus"
"people".singularize()      # => "person"
"feet".singularize()        # => "foot"

Quantities:

"person".pluralize(1)       # => "person"
"person".pluralize(2)       # => "people"

Install

repositories {
    jcenter()
    maven { url "https://jitpack.io" }
 }
 dependencies {
    compile 'com.github.cesarferreira:kotlin-pluralizer:1.0.0'
 }

Contributing

I welcome and encourage all pull requests. It usually will take me within 24-48 hours to respond to any issue or request. Here are some basic rules to follow to ensure timely addition of your request:

  1. Match coding style (braces, spacing, etc.) This is best achieved using CMD+Option+L (Reformat code) on Mac (not sure for Windows) with Android Studio defaults.
  2. If its a feature, bugfix, or anything please only change code to what you specify.
  3. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)
  4. Pull requests must be made against develop branch. Any other branch (unless specified by the maintainers) will get rejected.
  5. Check for existing issues first, before filing an issue.
  6. Have fun!

## Credits

The pluralize and singularize methods are based on the code found in the following places.

Created & Maintained By

Cesar Ferreira (@cesarmcferreira)

About

☀️ Kotlin extension to pluralize and singularize strings

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages