Skip to content

jackwanger/wego

Repository files navigation

wego

travis Go Report Card

屏蔽字过滤服务

用法

  1. https://github.com/repong/wego/releases 下载对应自己系统的版本,目前仅编译了linux和macOS版本
  2. tar zxf wego-osx-1.0.0.tar.gz
  3. ./wego (默认8000端口,可以使用./wego -port 1234修改监听端口)

运行情况如下:

$ ./wego -dict /tmp/dict1.txt,/tmp/dict2.txt
Version    : 1.1.0-1-g4345260
Git Hash   : a0bb954eeb2c277498b03da247bfe28625a5a2a9
Build Time : 2016-12-14T11:30:27Z
载入sego词典 /tmp/dict1.txt
载入sego词典 /tmp/dict2.txt
sego词典载入完毕
Listening at 8000
[GIN] 2016/12/15 - 15:45:46 | 200 |     148.311µs | 127.0.0.1 |   POST    /filter
[GIN] 2016/12/15 - 15:46:18 | 200 |      93.437µs | 127.0.0.1 |   GET    /validate

客户端如何调用?

  1. 验证是否包含屏蔽字
curl -XPOST http://localhost:8000/validate -d "message=测试封杀"
{"result":"false"}
  1. 过滤掉屏蔽字,以*号代替
curl -XPOST http://localhost:8000/filter -d "message=测试封杀"
{"result":"测试**"}

字典

Todo

  • http
  • gRPC

About

基于sego的屏蔽字服务

Resources

License

Stars

Watchers

Forks

Packages

No packages published