SensitiveWordFilter
a Java Web Project about “Sensitive Word Filter”
Install / Use
/learn @Jianfu-She/SensitiveWordFilterREADME
敏感词过滤
基于Trie树的敏感词过滤程序,提供HTTP API访问,基本解决了传统方法在中文分词上的缺陷。
API
- 过滤敏感词 输入一段文本,返回敏感词及敏感词替换为*号后的文本
- Request: /sensitive/filter
- Request Method: GET
- Params: text(String, required)
- Example:
http://115.28.74.55/wordfilter/sensitive/filter?text=❤白色情人节❤看色❤情人❤文片之老司 机8❤与 机❤❤8❤尼玛的格尼玛莎拉蒂
{
"errCode": 0,
"errMsg": "ok",
"content": {
"Sensitive Words": "色情,机8,尼玛,",
"Filtered Text": "❤白色情人节❤看*人❤文片之老司 机8❤与 *❤*的格尼玛莎拉蒂"
}
}
- 添加敏感词 添加一组敏感词
- Request: /sensitive/words
- Request Method: POST
- Params: words(String, required), list(String, required)
- Example:
// list在以下3项中选:blackList whiteListPre whiteListPost
// words以逗号分隔
http://115.28.74.55/wordfilter/sensitive/words?list=blackList&words=手枪,军火
{
"errCode": 0,
"errMsg": "ok",
"content": null
}
- 查看敏感词
- Request: /sensitive/words
- Request Method: GET
- Params: list(String, required)
- Example:
// list在以下3项中选:blackList whiteListPre whiteListPost
http://115.28.74.55/wordfilter/sensitive/words?list=blackList
{
"errCode": 0,
"errMsg": "ok",
"content": "色情,机8,尼玛,手枪,军火,"
}
http://115.28.74.55/wordfilter/sensitive/words?list=whiteListPre
{
"errCode": 0,
"errMsg": "ok",
"content": "司机,"
}
http://115.28.74.55/wordfilter/sensitive/words?list=whiteListPost
{
"errCode": 0,
"errMsg": "ok",
"content": "情人节,玛莎拉蒂,"
}
词库说明
blackList:敏感词黑名单 whiteListPre:敏感词前缀白名单 whiteListPost:敏感词后缀白名单
Related Skills
node-connect
352.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
