mirror of
https://github.com/ethauvin/kotlin-pluralizer.git
synced 2025-04-25 00:37:12 -07:00
60 lines
3.1 KiB
Markdown
60 lines
3.1 KiB
Markdown
<!--  -->
|
||
|
||
**Kotlin extension** to **pluralize** and **singularize** strings!
|
||
|
||
|
||
### Specs
|
||
[](https://travis-ci.org/cesarferreira/dryrun)
|
||
|
||
<!--
|
||
### Featured in
|
||
[](http://android-arsenal.com/details/1/2361)
|
||
[](http://androidweekly.net/issues/issue-200)
|
||
-->
|
||
|
||
### Show some :heart:
|
||
[](https://github.com/cesarferreira/dryrun) [](https://github.com/cesarferreira/dryrun/fork) [](https://github.com/cesarferreira/dryrun) [](https://github.com/cesarferreira/dryrun)
|
||
[](https://twitter.com/cesarmcferreira)
|
||
|
||
|
||
|
||
Partikular
|
||
ksingle
|
||
specialK
|
||
specifik
|
||
|
||
## Usage
|
||
|
||
```kotlin
|
||
"person".pluralize() # => "people"
|
||
"post".pluralize() # => "posts"
|
||
"octopus".pluralize() # => "octopi"
|
||
"sheep".pluralize() # => "sheep"
|
||
"words".pluralize() # => "words"
|
||
"CamelOctopus".pluralize() # => "CamelOctopi"
|
||
```
|
||
|
||
## Install
|
||
|
||
TODO
|
||
|
||
## Credits
|
||
|
||
The pluralize and singularize methods are based on the code found in the following places.
|
||
|
||
- https://github.com/atteo/evo-inflector/blob/master/src/main/java/org/atteo/evo/inflector/English.java
|
||
- http://www.java2s.com/Tutorial/Java/0040__Data-Type/Transformswordstosingularpluralhumanizedhumanreadableunderscorecamelcaseorordinalform.htm
|
||
- https://github.com/rails/rails/blob/26698fb91d88dca0f860adcb80528d8d3f0f6285/activesupport/lib/active_support/inflector/inflections.rb
|
||
|
||
|
||
## 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](https://github.com/cesarferreira/dryrun/issues) first, before filing an issue.
|
||
6. Have fun!
|
||
|
||
### Created & Maintained By
|
||
[Cesar Ferreira](https://github.com/cesarferreira) ([@cesarmcferreira](https://www.twitter.com/cesarmcferreira))
|