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

Uploaded Source

File details

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

File metadata

  • Download URL: replacy-0.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 f6bdc441fdaad9acfb72eb45aa7f48dc42e3d016abd838a67f17f792dab26579
MD5 b3d7ced0d849a1a0d014031bb7188fdc
BLAKE2b-256 f75b32ae654583b6df94f0bdf344cae52fe4e84488253bd7179c6d75088e4850

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