GitXplorerGitXplorer
g

inflector

public
16 stars
2 forks
1 issues

Commits

List of commits on branch master.
Unverified
41a8bd6d1bd7e1e95396a6db346e4124a59f6a6a

formatting

ggirishramnani committed 7 months ago
Unverified
11ef2e77f24b6c423f4a61b20d8b32e0a92616a1

added language to the code snippet in the readme

ggirishramnani committed 7 years ago
Unverified
58519be6007a9a189a96b97c11655247bd535a44

pushing new version

ggirishramnani committed 7 years ago
Unverified
849037dba000d005a506c50fc5b450f15c03a51e

using the config to extend the regex lists

ggirishramnani committed 7 years ago
Unverified
b865876fef37a979b4e1a7bdd76f924becfcfe12

implemented caching

ggirishramnani committed 7 years ago
Unverified
9732b5a4517055ae95dbb09e5b8bc81068a9f9cb

added build badge

ggirishramnani committed 7 years ago

README

The README file for this repository.

Inflectorex

Build Status

Inflectorex pluralizes and singularizes English nouns.

Usage

Inflectorex.singularize("workers") # will give "worker"

Inflectorex.pluralize("secret") # will give "secrets"

Extending the regex lists

Currently the application has 4 regex lists. You can extend these lists using the config block. To extend each of the lists the keys are as follows -

  • @plural_regexps - plural
  • @singular_regexps - singular
  • @singular_uninflected - singular_uninflected
  • @plural_uninflected - plural_uninflected

Note - right is the key

Example config

config  :inflectorex, plural: [
    {~r/developer/ , "developers"},
    {~r/elixir/, "elixirs"}
]  

Todo

  • [x] Implement caching
  • [x] Error handling
  • [ ] code commenting
  • [x] tests
  • [x] publishing to hex.pm

Credits

  • CakePHP's inflector
  • degex/inflector

License

MIT