{"id":14997623,"url":"https://github.com/zaibacu/rita-dsl","last_synced_at":"2025-10-30T06:30:40.586Z","repository":{"id":46166141,"uuid":"195552600","full_name":"zaibacu/rita-dsl","owner":"zaibacu","description":"A Domain Specific Language (DSL) for building language patterns. These can be later compiled into spaCy patterns, pure regex, or any other format","archived":false,"fork":false,"pushed_at":"2022-10-07T10:45:55.000Z","size":881,"stargazers_count":66,"open_issues_count":7,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-02T06:51:12.050Z","etag":null,"topics":["dsl","language","natural-language-processing","nlp","parsing","python","regex","rule-based","spacy"],"latest_commit_sha":null,"homepage":"","language":"Python","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/zaibacu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["zaibacu"]}},"created_at":"2019-07-06T15:07:26.000Z","updated_at":"2025-01-30T20:11:07.000Z","dependencies_parsed_at":"2022-09-26T21:31:07.655Z","dependency_job_id":null,"html_url":"https://github.com/zaibacu/rita-dsl","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaibacu%2Frita-dsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaibacu%2Frita-dsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaibacu%2Frita-dsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaibacu%2Frita-dsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaibacu","download_url":"https://codeload.github.com/zaibacu/rita-dsl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238937493,"owners_count":19555376,"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":["dsl","language","natural-language-processing","nlp","parsing","python","regex","rule-based","spacy"],"created_at":"2024-09-24T17:05:05.280Z","updated_at":"2025-10-30T06:30:34.865Z","avatar_url":"https://github.com/zaibacu.png","language":"Python","funding_links":["https://github.com/sponsors/zaibacu"],"categories":["Libraries","Python"],"sub_categories":["Books"],"readme":"![Rita Logo](docs/assets/logo-2.png)\n\n# RITA DSL\n\n[![Documentation Status](https://readthedocs.org/projects/rita-dsl/badge/?version=latest)](http://rita-dsl.readthedocs.io/?badge=latest)\n[![codecov](https://codecov.io/gh/zaibacu/rita-dsl/branch/master/graph/badge.svg)](https://codecov.io/gh/zaibacu/rita-dsl)\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/zaibacu/rita-dsl/graphs/commit-activity)\n[![PyPI version fury.io](https://badge.fury.io/py/rita-dsl.svg)](https://pypi.python.org/pypi/rita-dsl/)\n[![PyPI download month](https://img.shields.io/pypi/dm/rita-dsl.svg)](https://pypi.python.org/pypi/rita-dsl/)\n[![GitHub license](https://img.shields.io/github/license/zaibacu/rita-dsl.svg)](https://github.com/zaibacu/rita-dsl/blob/master/LICENSE)\n\nThis is a language, loosely based on language [Apache UIMA RUTA](https://uima.apache.org/ruta.html), focused on writing manual language rules, which compiles into either [spaCy](https://github.com/explosion/spaCy) compatible patterns, or pure regex. These patterns can be used for doing [manual NER](https://spacy.io/api/entityruler) as well as used in other processes, like retokenizing and pure matching\n\n## An Introduction Video\n[![Intro](https://img.youtube.com/vi/GScerMeWz68/0.jpg)](https://www.youtube.com/watch?v=GScerMeWz68)\n\n## Links\n- [Website](https://rita-dsl.io/)\n- [Simple Chat bot example](https://repl.it/talk/share/Simple-chatbot-done-with-Rita/53471)\n- [Documentation](http://rita-dsl.readthedocs.io/)\n- [QuickStart](https://rita-dsl.readthedocs.io/en/latest/quickstart/)\n- [Language Syntax Plugin for IntelijJ based IDEs](https://plugins.jetbrains.com/plugin/15011-rita-language) \n\n## Support\n\n[![reddit](https://img.shields.io/reddit/subreddit-subscribers/ritaDSL?style=social)](https://www.reddit.com/r/ritaDSL/)\n[![Gitter](https://badges.gitter.im/rita-dsl/community.svg)](https://gitter.im/rita-dsl/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\nIf you need consulting or some custom work done, you can [Contact Us](mailto:info@griaustinis.lt)\n\n## Install\n\n`pip install rita-dsl`\n\n## Simple Rules example\n\n```python\nrules = \"\"\"\ncuts = {\"fitted\", \"wide-cut\"}\nlengths = {\"short\", \"long\", \"calf-length\", \"knee-length\"}\nfabric_types = {\"soft\", \"airy\", \"crinkled\"}\nfabrics = {\"velour\", \"chiffon\", \"knit\", \"woven\", \"stretch\"}\n\n{IN_LIST(cuts)?, IN_LIST(lengths), WORD(\"dress\")}-\u003eMARK(\"DRESS_TYPE\")\n{IN_LIST(lengths), IN_LIST(cuts), WORD(\"dress\")}-\u003eMARK(\"DRESS_TYPE\")\n{IN_LIST(fabric_types)?, IN_LIST(fabrics)}-\u003eMARK(\"DRESS_FABRIC\")\n\"\"\"\n```\n\n### Loading in spaCy\n```python\nimport spacy\nfrom rita.shortcuts import setup_spacy\n\n\nnlp = spacy.load(\"en\")\nsetup_spacy(nlp, rules_string=rules)\n```\n\nAnd using it:\n```python\n\u003e\u003e\u003e r = nlp(\"She was wearing a short wide-cut dress\")\n\u003e\u003e\u003e [{\"label\": e.label_, \"text\": e.text} for e in r.ents]\n[{'label': 'DRESS_TYPE', 'text': 'short wide-cut dress'}]\n```\n\n### Loading using Regex (standalone)\n```python\nimport rita\n\npatterns = rita.compile_string(rules, use_engine=\"standalone\")\n```\n\nAnd using it:\n```python\n\u003e\u003e\u003e list(patterns.execute(\"She was wearing a short wide-cut dress\"))\n[{'end': 38, 'label': 'DRESS_TYPE', 'start': 18, 'text': 'short wide-cut dress'}]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaibacu%2Frita-dsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaibacu%2Frita-dsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaibacu%2Frita-dsl/lists"}