cooldfa-1.0.4
توضیحات
一个基于DFA算法的敏感词检测器
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | cooldfa-1.0.4 |
| نام | cooldfa |
| نسخه کتابخانه | 1.0.4 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | 许灿标 <lcctoor@outlook.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/cooldfa/ |
| مجوز | - |
# 项目描述
一个基于DFA算法的敏感词检测器。
# 安装
```
pip install cooldfa
```
# Bug提交、功能提议
您可以通过 [Github-Issues](https://github.com/lcctoor/lccpy/issues)、[微信](https://raw.githubusercontent.com/lcctoor/me/main/author/WeChatQR.jpg)、[技术交流群](https://raw.githubusercontent.com/lcctoor/me/main/ExchangeGroup/PythonTecQR.jpg) 与我联系。
# 关于作者
作者:许灿标
邮箱:lcctoor@outlook.com
[主页](https://github.com/lcctoor/me/blob/main/home.md) | [微信](https://raw.githubusercontent.com/lcctoor/me/main/author/WeChatQR.jpg) | [Python技术微信交流群](https://raw.githubusercontent.com/lcctoor/me/main/ExchangeGroup/PythonTecQR.jpg)
开源项目:[让 Python 更简单一点](https://github.com/lcctoor/lccpy#readme)
# 教程
导入:
```python
from cooldfa import dfa
```
创建dfa模型:
```python
敏感词S = ['123', '56', 'end']
example = dfa(敏感词S)
```
查找第1个敏感词:
```python
example.find_one('1--2--3--4--5--6--7--8--9--end--')
# >>> '1--2--3'
```
查找所有敏感词:
```python
example.find_all('1--2--3--4--5--6--7--8--9--end--')
# >>> ['1--2--3', '5--6', 'end']
```
替换所有敏感词:
```python
example.sub('1--2--3--4--5--6--7--8--9--end--', '*')
# >>> '*******--4--****--7--8--9--***--'
```
使用预置的敏感词库:
```python
from cooldfa import dfa, preset_words
example = dfa(
preset_words.politics, # 政治类
preset_words.sex, # 色情类
preset_words.violence, # 暴力类
preset_words.url, # 网址
preset_words.others, # 其它
)
```
# 支持作者1元
cooldfa 是一个免费的开源项目,由个人维护。
每个小的贡献,都是构成车轮的一份子,可以帮助保持车轮完美旋转。

زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10 | Python |
نحوه نصب
نصب پکیج whl cooldfa-1.0.4:
pip install cooldfa-1.0.4.whl
نصب پکیج tar.gz cooldfa-1.0.4:
pip install cooldfa-1.0.4.tar.gz