dfa filter func
Project description
Installing
Install with pip
pip install nest-dfa==1.1.0
Usage
-
DFAFilter用法
:explain: 敏感词过滤
:syntax: DFAFilter(sensitive_words: str = "sensitive_words.txt") -> None
:syntax: filter(self, message: str, repl: str="*") -> str
:param: sensitive_words, 敏感词文本文件地址,默认当前路径下的sensitive_words.txt
:param: message 需要检测敏感词的字符串
:param: repl 敏感词需要替换的标识,默认为 *
:return: 过滤后的字符串
>>> from pydfa.dfa import DFAFilter >>> dfa = DFAFilter() >>> message = "大家足球投注哈麻醉" >>> print(dfa.filter(message)) >>> "大家****哈**"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nest-dfa-1.1.0.tar.gz
(2.2 kB
view details)
File details
Details for the file nest-dfa-1.1.0.tar.gz
.
File metadata
- Download URL: nest-dfa-1.1.0.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58de94b10fb6c485f92ccd365bd228d87289e5aa9452197699cc72ff2c3c4de7 |
|
MD5 | 2eb7706b3e1331a6fc54532cabd03470 |
|
BLAKE2b-256 | 826f8af6ae56d641dc981732d110da2c3792d2eb0cfb4ae0fbad89697f9c3f3a |