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)

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

Uploaded Source

File details

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

File metadata

  • Download URL: replacy-0.2.0.tar.gz
  • Upload date:
  • Size: 4.6 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.2.0.tar.gz
Algorithm Hash digest
SHA256 9481d08b7cc6ec48ac1b8098ae2c8fba646c353e6ca23efccf62ef5c0c8d21b6
MD5 6d4f787e29e3eacaca0d9e6537d79486
BLAKE2b-256 defc3564c10e604406761da750aca05ea2509c7389407cf64614a944997f087d

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