Skip to main content

ReplaCy = spaCy Matcher + pyInflect. Create rules, correct sentences.

Project description

replaCy

Requirements

  • spacy >= 2.0 (not installed by default, expected nlp object)

Installation

pip install replacy

Quick start

from replacy import ReplaceMatcher
import spacy
from replacy.db import get_match_dict

# load custom match_dict, see example in : resources/match_dict.json
match_dict = get_match_dict()

# load nlp spacy model of your choice
nlp = spacy.load("en_core_web_sm")

rmatcher = ReplaceMatcher(nlp, match_dict)

# get inflected suggestions
# look up the first suggestion
span = rmatcher("She extracts revenge.")[0]
>>> span._.suggestions
['exacts']

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-0.4.0.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file replacy-0.4.0.tar.gz.

File metadata

  • Download URL: replacy-0.4.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.6.9

File hashes

Hashes for replacy-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c46a8909bad6c8a5f60b251b3b7d028235c4ffd15b2ea3344ac9c05f0ce3ed5b
MD5 9f7cb4a7b56d724d22e2cd0bd8fadd2b
BLAKE2b-256 9dbf9212cedbd4d9b1bce036a94d6560129e35480ee9215471ede6c9495f7852

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