{"id":13992722,"url":"https://github.com/mattt/InflectorKit","last_synced_at":"2025-07-22T16:31:30.512Z","repository":{"id":7441774,"uuid":"8782561","full_name":"mattt/InflectorKit","owner":"mattt","description":"Efficiently Singularize and Pluralize Strings","archived":false,"fork":false,"pushed_at":"2020-12-04T12:33:50.000Z","size":34,"stargazers_count":479,"open_issues_count":2,"forks_count":33,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-27T05:17:52.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/mattt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-14T18:37:53.000Z","updated_at":"2025-01-17T15:53:56.000Z","dependencies_parsed_at":"2022-09-02T17:08:45.244Z","dependency_job_id":null,"html_url":"https://github.com/mattt/InflectorKit","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mattt/InflectorKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FInflectorKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FInflectorKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FInflectorKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FInflectorKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattt","download_url":"https://codeload.github.com/mattt/InflectorKit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattt%2FInflectorKit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266531083,"owners_count":23944041,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-08-09T14:02:06.316Z","updated_at":"2025-07-22T16:31:30.144Z","avatar_url":"https://github.com/mattt.png","language":"Objective-C","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"readme":"# InflectorKit\n![CI][ci badge]\n\nInflectorKit is a port of the string inflection functionality from\n[Rails ActiveSupport](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflector/inflections.rb) for Swift and Objective-C.\n\n\u003e InflectorKit joins [FormatterKit](https://github.com/mattt/FormatterKit) \u0026 [TransformerKit](https://github.com/mattt/TransformerKit) in providing well-designed APIs for manipulating user-facing content.\n\n## Usage\n\n### Swift\n\n```swift\nimport InflectorKit\n\nfor singular in [\"person\", \"tomato\", \"matrix\", \"octopus\", \"fish\"] {\n    print(\"\\(singular) → \\(singular.pluralized)\")\n}\n/*\nPrints:\nperson → people\ntomato → tomatoes\nmatrix → matrices\noctopus → octopi\nfish → fish\n*/\n\n// You can also add pluralization rules,\n// including irregular and uncountable words:\n\nlet inflector = StringInflector.default\ninflector.addPluralRule(#\"^i(Pod|Pad)( Mini)?$\"#, replacement: #\"i$1s$2\"#)\ninflector.addIrregular(singular: \"lol\", plural: \"lolz\")\ninflector.addUncountable(\"Herokai\")\n\nfor singular in [\"iPad Mini\", \"lol\", \"Herokai\"] {\n    print(\"\\(singular) → \\(singular.pluralized)\")\n}\n/*\nPrints:\niPad Mini → iPads Mini\nlol → lolz\nHerokai → Herokai\n*/\n```\n\n### Objective-C\n\n```objective-c\n#import \"NSString+InflectorKit.h\"\n\nfor (NSString *singular in @[@\"person\", @\"tomato\", @\"matrix\", @\"octopus\", @\"fish\"]) {\n  NSLog(@\"%@ → %@\", singular, [singular pluralizedString]);\n}\n\n/*\nPrints:\nperson → people\ntomato → tomatoes\nmatrix → matrices\noctopus → octopi\nfish → fish\n*/\n\n// You can also add pluralization rules,\n// including irregular and uncountable words:\n\nTTTStringInflector *inflector = [TTTStringInflector defaultInflector];\n[inflector addPluralRule:@\"^i(Pod|Pad)( Mini)?$\" withReplacement:@\"i$1s$2\"];\n[inflector addIrregularWithSingular:@\"lol\" plural:@\"lolz\"];\n[inflector addUncountable:@\"Herokai\"];\n\nfor (NSString *singular in @[@\"iPad Mini\", @\"lol\", @\"Herokai\"]) {\n  NSLog(@\"%@ → %@\", singular, [singular pluralizedString]);\n}\n\n/*\nPrints:\niPad Mini → iPads Mini\nlol → lolz\nHerokai → Herokai\n*/\n```\n\n## Installation\n\n### Swift Package Manager\n\nAdd the InflectorKit package to your target dependencies in `Package.swift`:\n\n```swift\nimport PackageDescription\n\nlet package = Package(\n  name: \"YourProject\",\n  dependencies: [\n    .package(\n        url: \"https://github.com/mattt/InflectorKit\",\n        from: \"1.0.0\"\n    ),\n  ]\n)\n```\n\nThen run the `swift build` command to build your project.\n\n### CocoaPods\n\nYou can install `InflectorKit` via CocoaPods,\nby adding the following line to your `Podfile`:\n\n```ruby\npod 'InflectorKit', '~\u003e 1.0.0'\n```\n\nRun the `pod install` command to download the library\nand integrate it into your Xcode project.\n\n## License\n\nMIT\n\n## Contact\n\nMattt ([@mattt](https://twitter.com/mattt))\n\n[ci badge]: https://github.com/mattt/InflectorKit/workflows/CI/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattt%2FInflectorKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattt%2FInflectorKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattt%2FInflectorKit/lists"}