{"id":19059947,"url":"https://github.com/q-m/tiered_category_expressions","last_synced_at":"2026-07-12T18:31:29.598Z","repository":{"id":59159150,"uuid":"178944607","full_name":"q-m/tiered_category_expressions","owner":"q-m","description":"Work with TCEs in Ruby","archived":false,"fork":false,"pushed_at":"2025-11-25T07:42:12.000Z","size":103,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-28T15:01:38.788Z","etag":null,"topics":["categories","expression","language","parser","pattern-matching","regular-expressions"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/q-m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-04-01T20:48:54.000Z","updated_at":"2025-11-25T07:42:09.000Z","dependencies_parsed_at":"2024-11-09T00:12:42.956Z","dependency_job_id":"a3a5b277-6b64-4fea-86a5-d90d861e07f5","html_url":"https://github.com/q-m/tiered_category_expressions","commit_stats":{"total_commits":26,"total_committers":3,"mean_commits":8.666666666666666,"dds":"0.15384615384615385","last_synced_commit":"76b989f2a9888ce80a7da17cabfb3c939e3ac72d"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/q-m/tiered_category_expressions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q-m%2Ftiered_category_expressions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q-m%2Ftiered_category_expressions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q-m%2Ftiered_category_expressions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q-m%2Ftiered_category_expressions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/q-m","download_url":"https://codeload.github.com/q-m/tiered_category_expressions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q-m%2Ftiered_category_expressions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35400292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["categories","expression","language","parser","pattern-matching","regular-expressions"],"created_at":"2024-11-09T00:12:15.558Z","updated_at":"2026-07-12T18:31:29.581Z","avatar_url":"https://github.com/q-m.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv style=\"float: right\"\u003e\n\u003ca href=\"https://badge.fury.io/rb/tiered_category_expressions\"\u003e\u003cimg src=\"https://badge.fury.io/rb/tiered_category_expressions.svg\" alt=\"Rubygem\" height=\"18\" /\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n# Tiered Category Expressions\n\nWork with TCE v1.1 in Ruby.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'tiered_category_expressions'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install tiered_category_expressions\n\nAnd require with:\n\n```ruby\nrequire 'tiered_category_expressions'\n```\n\nOr, if you don't want the `TCE()` alias in the global namespace, require with:\n\n```ruby\nrequire 'tiered_category_expressions/core'\n```\n\n## Documentation\n\n  - [Library documentation](https://www.rubydoc.info/gems/tiered_category_expressions/)\n  - [TCE language reference](https://www.rubydoc.info/gems/tiered_category_expressions/file/LANGREF.md)\n  - [Introductory blogpost](https://developers.thequestionmark.org/2019/07/24/pattern-matching-expert-system-classification)\n\n## Usage examples\n\n```ruby\ntce = TCE(\"groceries \u003e nonfood | pharmacy \u003e\u003e !baby formula\")\n# =\u003e TieredCategoryExpressions::Expression\n\ntce.matches?([\"Groceries\", \"Non-food\", \"Cleaning\", \"Soap\"])\n# =\u003e true\n\ntce.matches?([\"Groceries\", \"Non-food\", \"Baby\", \"Baby formula\"])\n# =\u003e false\n\ntce.matches?([\"Groceries\", \"Pharmacy\", \"Baby\", \"Pacifiers\"])\n# =\u003e true\n\ntce.to_regexp\n# =\u003e Regexp\n\ntce.as_regexp\n# =\u003e String\n\nTCE(\"groceries \u003e nonfood\") \u003e TCE(\"baby\") \u003e \"\u003e\u003e pacifiers\"\n# =\u003e TieredCategoryExpressions::Expression\n```\n\n## Development\n\nRun `rake spec` to run the tests. You can also run `bundle console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb` and run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/q-m/tiered_category_expressions.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fq-m%2Ftiered_category_expressions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fq-m%2Ftiered_category_expressions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fq-m%2Ftiered_category_expressions/lists"}