Metadata-Version: 2.1
Name: rita-dsl
Version: 0.4.3
Summary: DSL for building language rules
Home-page: https://github.com/zaibacu/rita-dsl
Author: Šarūnas Navickas
Author-email: zaibacu@gmail.com
License: MIT
Description: # RITA DSL
        
        [![Documentation Status](https://readthedocs.org/projects/rita-dsl/badge/?version=latest)](http://rita-dsl.readthedocs.io/?badge=latest)
        [![codecov](https://codecov.io/gh/zaibacu/rita-dsl/branch/master/graph/badge.svg)](https://codecov.io/gh/zaibacu/rita-dsl)
        [![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)
        [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/zaibacu/rita-dsl/graphs/commit-activity)
        [![PyPI version fury.io](https://badge.fury.io/py/rita-dsl.svg)](https://pypi.python.org/pypi/rita-dsl/)
        [![PyPI download month](https://img.shields.io/pypi/dm/rita-dsl.svg)](https://pypi.python.org/pypi/rita-dsl/)
        [![GitHub license](https://img.shields.io/github/license/zaibacu/rita-dsl.svg)](https://github.com/zaibacu/rita-dsl/blob/master/LICENSE)
        
        This 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 [spaCy](https://github.com/explosion/spaCy) compatible patterns. 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
        
        
        
        ## Links
        - [Live Demo](https://rita-demo.herokuapp.com/)
        - [Documentation](http://rita-dsl.readthedocs.io/)
        - [QuickStart](https://rita-dsl.readthedocs.io/en/latest/quickstart/)
        
        ## Support
        
        [![reddit](https://img.shields.io/reddit/subreddit-subscribers/ritaDSL?style=social)](https://www.reddit.com/r/ritaDSL/)
        
        
        ## Simple Rules example
        
        ```python
        rules = """
        cuts = {"fitted", "wide-cut"}
        lengths = {"short", "long", "calf-length", "knee-length"}
        fabric_types = {"soft", "airy", "crinkled"}
        fabrics = {"velour", "chiffon", "knit", "woven", "stretch"}
        
        {IN_LIST(cuts)?, IN_LIST(lengths), WORD("dress")}->MARK("DRESS_TYPE")
        {IN_LIST(lengths), IN_LIST(cuts), WORD("dress")}->MARK("DRESS_TYPE")
        {IN_LIST(fabric_types)?, IN_LIST(fabrics)}->MARK("DRESS_FABRIC")
        """
        ```
        
        ### Loading in spaCy
        ```python
        import spacy
        from rita.shortcuts import setup_spacy
        
        
        nlp = spacy.load("en")
        setup_spacy(nlp, rules_string=rules)
        ```
        
        And using it:
        ```
        >>> r = nlp("She was wearing a short wide-cut dress")
        >>> [{"label": e.label_, "text": e.text} for e in r.ents]
        [{'label': 'DRESS_TYPE', 'text': 'short wide-cut dress'}]
        ```
        
        ### Loading using Regex (standalone)
        ```
        import rita
        
        patterns = rita.compile_string(rules, use_engine="standalone")
        ```
        
        And using it:
        ```
        >>> list(patterns.execute("She was wearing a short wide-cut dress"))
        [{'end': 38, 'label': 'DRESS_TYPE', 'start': 18, 'text': 'short wide-cut dress'}]
        ```## Changelog
        0.4.0 (2020-01-25)
        ****************************
        
        Features
        --------
        
        - Support for deaccent. In general, if accented version of word is given, both deaccented and accented will be used to match. To turn iit off - `!CONFIG("deaccent", "N")`
          #38
        - Added shortcuts module to simplify injecting into spaCy
          #42
        
        Fix
        ---
        
        - Fix issue regarding Spacy rules with `IN_LIST` and using case-sensitive mode. It was creating Regex pattern which is not valid spacy pattern
          #40
        
        
        0.3.2 (2019-12-19)
        ***********************
        
        Features
        --------
        
        - - Introduced `towncrier` to track changes
          - Added linter `flake8`
          - Refactored code to match `pep8`
          #32
        
        Fix
        ---
        
        - - Fix WORD split by `-`
        
          - Split by ` ` (empty space) as well
        
          - Coverage score increase
          #35
        
        
        
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Description-Content-Type: text/markdown
