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,']
# }
# }
#}
```
## 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.1.tar.gz
(3.0 kB
view details)
File details
Details for the file pyhachi-0.2.1.tar.gz
.
File metadata
- Download URL: pyhachi-0.2.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4d3c495b3a7e41e7801a3602db512426522d5862f59134db8edc8dedcc33778 |
|
MD5 | 1129724acdc7920b3f64b5da4297a063 |
|
BLAKE2b-256 | fd344dadaf950b63d612fd4581f81fd3343777c7d3e0d571c7d10427ccb57939 |