cadmium_inflector
Version, currently 0.2.01 version
- 0.2.0latestJan 9, 2026
github.com/cadmiumcr/inflector
No description declared in shard.yml.
0 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
cadmium_inflector:
github: cadmiumcr/inflector
version: ~> 0.2.0Then run:
shards installshard.yml
- Crystal
0.30.1- License
- MIT
- Author
- Chris Watson
Dependencies
This version declares no dependencies.
README
Inflector
Installation
-
Add the dependency to your
shard.yml:dependencies: cadmium_inflector: github: cadmiumcr/inflector -
Run
shards install
Usage
require "cadmium_inflector"
Nouns
Nouns can be inflected using the NounInflector which has also been attached to the String class.
inflector = Cadmium.noun_inflector.new
inflector.pluralize("radius")
# => radii
inflector.singularize("radii")
# => radius
"person".pluralize
# => people
"people".singularize
# => person
Present Tense Verbs
Present tense verbs can be inflected with the PresentVerbInflector. This has also been attached to the string class.
inflector = Cadmium.present_verb_inflector.new
inflector.singularize("become")
# => became
inflector.pluralize("became")
# => become
"walk".singularize(false) # noun: false
# => walks
"walks".pluralize(false) # noun: false
# => walk
Numbers
Numbers can be inflected with the CountInflector which also adds a method to_nth to the Int class.
Cadmium.count_inflector.nth(1)
# => 1st
Cadmium.count_inflector.nth(111)
# => 111th
153.to_nth
# => 153rd
Contributing
- Fork it (https://github.com/your-github-user/cadmium_inflectors/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Chris Watson - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.0- Tagged
- Jan 9, 2026
- Commit
8ddc0e090720- Crystal
0.30.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/cadmiumcr/inflector
Metadata
- Created
- Aug 17, 2026
- Updated
- Aug 17, 2026
- Synced
- Aug 17, 2026
- Versions
- 1