Skip to main content

A lib for Chinese text preprocessing

Project description

Chinese text preprocess

You can extract numbers, email, website, emoji, tex, and delete spaces, punctuations.

Install

>> pip install cnprep

Usage

from cnprep import Extractor
ext = Extractor(args=['email', 'number'], limit=5)
ext.extract(message)
args: option
    e.g. ['email', 'telephone'] or 'email, telephone'
    email
    telephone
    web
    QQ
    tex
    wechat
    blur (Ⅰ①壹...)
limit: parameter for get_number (blur)

Also, you can use ‘’ext.reset_param()’’ to reset the parameters.

Attention

The URL extractor only support ‘http(s)’ and ‘www’ with ASCII

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

cnprep-0.1.8.tar.gz (6.0 kB view details)

Uploaded Source

File details

Details for the file cnprep-0.1.8.tar.gz.

File metadata

  • Download URL: cnprep-0.1.8.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cnprep-0.1.8.tar.gz
Algorithm Hash digest
SHA256 1ea016b71b1c0639456527608d50b9fa5650c7bb061a72aa53736bbdb258559a
MD5 e3ed76ed941c2a57502a899773d9b373
BLAKE2b-256 1353132e9b5b58607e9b6360ed717e5d91ced5ac83a33232daadab37f385d6f5

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