Skip to main content

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.

Project description

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

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")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

replacy-article-agreer-0.2.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

replacy_article_agreer-0.2.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file replacy-article-agreer-0.2.2.tar.gz.

File metadata

  • Download URL: replacy-article-agreer-0.2.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.4.0-1025-azure

File hashes

Hashes for replacy-article-agreer-0.2.2.tar.gz
Algorithm Hash digest
SHA256 83a36abd69a3d3e0b7f3c6946df1bb79ba78d92a23d3ae0729990a7e4461a6d7
MD5 4853ff3d53d126ecfc0ec1eef74fc264
BLAKE2b-256 56165c8b62b86b07552229d05fa1b1b50d754c982c19223b0f336cd105e30a59

See more details on using hashes here.

File details

Details for the file replacy_article_agreer-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for replacy_article_agreer-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b24ab054f0ec074f9131c9e8773b8560e912cd934cbd78c1528fdbd498be086c
MD5 201240fb50e3b75e77409c3c9d2ac4c0
BLAKE2b-256 5d2b19ded922f36372b627009e177fed9d6468f6b08f1adf26c8e3d106ce18b5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page