Metadata-Version: 2.1
Name: replacy-article-agreer
Version: 0.2.2
Summary: A replaCy component to manage indirect article agreement, that is, to deal with making "a" and "an" be correct so you don't have to think about them in your matches.
Home-page: https://github.com/Qordobacode/replacy_article_agreer
License: MIT
Keywords: replacy,spacy,nlp,languagetool
Author: Sam Havens
Author-email: sam.havens@qordoba.com
Requires-Python: >=3.8,<4.0
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Typing :: Typed
Requires-Dist: importlib_metadata (>=1.7.0,<2.0.0); python_version < "3.8"
Requires-Dist: inflect (>=4.1.0,<5.0.0)
Project-URL: Repository, https://github.com/Qordobacode/replacy_article_agreer
Description-Content-Type: text/markdown

# replaCy Article Agreer

A replaCy component to manage indirect article agreement, that is, to deal with making "a" and "an" be correct so you don't have to think about them in your matches.

## Warning

This replaCy component touches `suggestions` (`span._.suggestions`) generated by replaCy, and *assumes that they are text*. This means you MUST attach add this component to the pipeline **after the joiner**. Otherwise, this component tries to raise `ReplacyPipelineOrderError` to tell you this.

## Install

`poetry add replacy_article_agreer`

or

`pip install replacy_article_agreer`

## Usage

```python
import en_core_web_sm
from replacy import ReplaceMatcher
from replacy.db import load_json
from replacy_article_agreer import ArticleAgreer
from spacy.util import filter_spans


nlp = en_core_web_sm.load()
replaCy = ReplaceMatcher(nlp, load_json('path to match dict(s)'))

aa = ArticleAgreer()

# filtering spans first isn't strictly necessary, but recommended
replaCy.add_pipe(filter_spans, name="filter_spans", before="joiner")
replaCy.add_pipe(aa, name="article_agreer", after="joiner")
```

