Skip to main content

spam filter

Project description

# PyHachi


## Quick Start

```python
from pyhachi import HachiModel
from pyhachi import BlacklistPlugin, PatternPlugin


plug_1 = BlacklistPlugin(words_list=["1989", "天安门"])
plug_2 = PatternPlugin()

model = HachiModel(plugins=[plug_1, plug_2])

query = ("1989年的夏天,我们一起在天安门广场跳舞,你还记得吗。当时的天安门有好多人。\
我的手机号是13126658707, 我的个人网站www.zaih.com, 我的微信号xiaoxiongmao4223, QQ 472146772\
123o4usdjfk@gmail.com, or sfjjsaf@163.com")

res = model.check(query)

print(res)

#{
# 'blacklist_qj10eo':
# {
# 'nigger_char': {'天安门': 2, '1989': 1},
# 'nigger_word': {'天安门': 1, '1989': 1}
# }
# 'pattern_t9rurf':
# {
# 'special_pattern':
# {
# 'wechat': ['xiaoxiongmao4223'],
# 'telephone': ['13126658707'],
# 'email': ['123o4usdjfk@gmail.com', 'sfjjsaf@163.com'],
# 'QQ': ['472146772'],
# 'url': ['www.zaih.com,']
# }
# }
#}
```

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

pyhachi-0.2.2.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file pyhachi-0.2.2.tar.gz.

File metadata

  • Download URL: pyhachi-0.2.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.17.3 setuptools/38.5.1 requests-toolbelt/0.9.1 tqdm/4.15.0 CPython/3.5.2

File hashes

Hashes for pyhachi-0.2.2.tar.gz
Algorithm Hash digest
SHA256 8c41aa4439be4f81c38a6ed657e1917e63ac033557145a079298bb7129680d90
MD5 b989c9f735d9caf9066dfb26f97b9bf9
BLAKE2b-256 3e1c03dc82cd83c048c90f532ecf72b0f58172323b947802350d53df5ea6a62e

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