1
0
Fork 0
mirror of https://github.com/ethauvin/kotlin-pluralizer.git synced 2025-04-24 16:27:12 -07:00
☀️ Kotlin extension to pluralize and singularize strings
Find a file
2016-09-10 12:48:02 +01:00
android-sample few tweaks and package name change 2016-09-05 14:51:55 +01:00
gradle/wrapper lowered gradle version 2016-09-04 21:21:44 +01:00
library Added pluralize/singularize functions based on an int count. 2016-09-05 20:22:42 -07:00
.gitignore first commit 2016-09-04 13:11:14 +01:00
.travis.yml added tracisci 2016-09-04 13:13:38 +01:00
build.gradle updated readme 2016-09-05 20:33:38 +01:00
gradle.properties first commit 2016-09-04 13:11:14 +01:00
gradlew added required files to publish 2016-09-04 17:46:07 +01:00
gradlew.bat added required files to publish 2016-09-04 17:46:07 +01:00
LICENSE Initial commit 2016-09-04 13:10:18 +01:00
README.md Merge branch 'master' of github.com:cesarferreira/kotlin-pluralizer 2016-09-10 12:48:02 +01:00
settings.gradle refactoring 2016-09-04 23:33:25 +01:00

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"

Singuralization:

"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:0.2.7'
 }

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)