{"id":27947886,"url":"https://github.com/luckyframework/wordsmith","last_synced_at":"2025-05-07T14:38:42.427Z","repository":{"id":39643934,"uuid":"153805410","full_name":"luckyframework/wordsmith","owner":"luckyframework","description":"Handles pluralization, ordinalizing words, etc.","archived":false,"fork":false,"pushed_at":"2023-04-04T18:26:56.000Z","size":95,"stargazers_count":13,"open_issues_count":0,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-05-06T00:04:55.287Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luckyframework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-19T15:37:11.000Z","updated_at":"2024-05-06T00:04:55.288Z","dependencies_parsed_at":"2022-08-09T15:03:08.076Z","dependency_job_id":null,"html_url":"https://github.com/luckyframework/wordsmith","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckyframework%2Fwordsmith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckyframework%2Fwordsmith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckyframework%2Fwordsmith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckyframework%2Fwordsmith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luckyframework","download_url":"https://codeload.github.com/luckyframework/wordsmith/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252896912,"owners_count":21821358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T14:38:40.596Z","updated_at":"2025-05-07T14:38:42.400Z","avatar_url":"https://github.com/luckyframework.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wordsmith\n\n[![API Documentation Website](https://img.shields.io/website?down_color=red\u0026down_message=Offline\u0026label=API%20Documentation\u0026up_message=Online\u0026url=https%3A%2F%2Fluckyframework.github.io%2Fwordsmith%2F)](https://luckyframework.github.io/wordsmith)\n\nWordsmith is a library for pluralizing, ordinalizing, singularizing and doing\nother fun and useful things with words.\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  wordsmith:\n    github: luckyframework/wordsmith\n```\n\n## Usage\n\n```crystal\nrequire \"wordsmith\"\n\nWordsmith::Inflector.pluralize(\"word\") # \"words\"\nWordsmith::Inflector.singularize(\"categories\") # \"category\"\nWordsmith::Inflector.camelize(\"application_controller\") # \"ApplicationController\"\nWordsmith::Inflector.underscore(\"CheeseBurger\") # \"cheese_burger\"\nWordsmith::Inflector.humanize(\"employee_id\") # \"Employee\"\nWordsmith::Inflector.titleize(\"amazon web services\") # \"Amazon Web Services\"\nWordsmith::Inflector.tableize(\"User\") # \"users\"\nWordsmith::Inflector.classify(\"users\") # \"User\"\nWordsmith::Inflector.dasherize(\"post_office\") # \"post-office\"\nWordsmith::Inflector.ordinalize(4) # \"4th\"\nWordsmith::Inflector.demodulize(\"Helpers::Mixins::User\") # \"User\"\nWordsmith::Inflector.deconstantize(\"User::FREE_TIER_COMMENTS\") # \"User\"\nWordsmith::Inflector.foreign_key(\"Person\") # \"person_id\"\nWordsmith::Inflector.parameterize(\"Admin/product\") # \"admin-product\"\n```\n\nWordsmith comes with a `ws` CLI utility which allows you to process words from the command line. You can download it directly from the [releases page](https://github.com/luckyframework/wordsmith/releases).\n\n```sh\n ╰─ $ ./ws \nUsage: ws \u003coption\u003e WORD\n\nWordsmith is a library for pluralizing, singularizing and doing\nother fun and useful things with words.\n\nCommand `ws` is the command line version of Wordsmith, not all\nfeatures of Wordsmith are implemented, for precompiled binary,\nplease download from github releases page.\n\nhttps://github.com/luckyframework/wordsmith/releases\n\nsome examples:\n\n$: ws -s people # =\u003e person\n$: ws -p person # =\u003e people\n\nYou can use it with pipe:\n\n$: echo \"WordSmith\" |ws -u |ws -d # =\u003e word-smith\n\nmore examples, please check https://github.com/luckyframework/wordsmith#usage\n\n    -s WORD, --singularize=WORD      Return the singular version of the word.\n    -p WORD, --pluralize=WORD        Return the plural version of the word.\n    -c WORD, --camelize=WORD         Return the camel-case version of that word.\n    -C WORD, --camelize-downcase=WORD\n                                     Return the camel-case version of that word, but the first letter not capitalized.\n    -u WORD, --underscore=WORD       Convert a given camel-case word to it's underscored version.\n    -d WORD, --dasherize=WORD        Convert a given underscore-separated word to the same word, separated by dashes.\n    -h, --help                       Show this help\n```\n\n## Custom inflections\n\nIf something isn't pluralizing correctly, it's easy to customize.\n\n```crystal\n# Place this in a config file like `config/inflectors.cr`\nrequire \"wordsmith\"\n\n# To pluralize a single string in a specific way\nWordsmith::Inflector.inflections.irregular(\"human\", \"humans\")\n\n# To stop Wordsmith from pluralizing a word altogether\nWordsmith::Inflector.inflections.uncountable(\"equipment\")\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/luckyframework/wordsmith/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Make your changes\n4. Run `./bin/test` to run the specs, build shards, and check formatting\n5. Commit your changes (git commit -am 'Add some feature')\n6. Push to the branch (git push origin my-new-feature)\n7. Create a new Pull Request\n\n## Testing\n\nTo run the tests:\n\n- Run the tests with `./bin/test`\n\n## Contributors\n\n- [paulcsmith](https://github.com/paulcsmith) Paul Smith - creator, maintainer\n- [actsasflinn](https://github.com/actsasflinn) Flinn Mueller - contributor\n\n## Thanks \u0026 attributions\n\n- Inflector is based on [Rails](https://github.com/rails/rails). Thank you to the Rails team!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluckyframework%2Fwordsmith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluckyframework%2Fwordsmith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluckyframework%2Fwordsmith/lists"}