{"id":37219367,"url":"https://github.com/cyuxlif/go-word-filter","last_synced_at":"2026-01-15T01:16:12.771Z","repository":{"id":57540459,"uuid":"92020812","full_name":"cyuxlif/go-word-filter","owner":"cyuxlif","description":"基于trie树的敏感词，脏词过滤服务， 支持grpc调用","archived":false,"fork":false,"pushed_at":"2017-05-27T11:22:33.000Z","size":7969,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T16:45:42.556Z","etag":null,"topics":["grpc","trie"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyuxlif.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-22T06:49:49.000Z","updated_at":"2024-06-20T16:45:42.556Z","dependencies_parsed_at":"2022-09-26T16:31:10.416Z","dependency_job_id":null,"html_url":"https://github.com/cyuxlif/go-word-filter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cyuxlif/go-word-filter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyuxlif%2Fgo-word-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyuxlif%2Fgo-word-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyuxlif%2Fgo-word-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyuxlif%2Fgo-word-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyuxlif","download_url":"https://codeload.github.com/cyuxlif/go-word-filter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyuxlif%2Fgo-word-filter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28441026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"ssl_error","status_checked_at":"2026-01-15T00:55:20.945Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc","trie"],"created_at":"2026-01-15T01:16:12.150Z","updated_at":"2026-01-15T01:16:12.740Z","avatar_url":"https://github.com/cyuxlif.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-word-filter\n\n基于trie树的敏感词过滤服务， 支持grpc调用\n\n\n## 安装\n\n```\n$ go get github.com/cyuxlif/go-word-filter\n\n$ cd $GOPATH/src/github.com/cyuxlif/go-word-filter/conf\n$ cp app.yaml.example app.yaml\n$ vim app.yaml #配置字典路径， 监听地址\n$ cd $GOPATH/src/github.com/cyuxlif/go-word-filter/cmd/word_filter\n$ go build\n$ ./word_filter -c /yourpath/conf/app.yaml\n```\n\n\n## 使用\n\n参考 $GOPATH/src/github.com/cyuxlif/go-word-filter/cmd/grpc_client\n\n部分代码如：\n```\n\t// 连接\n\tconn, err := grpc.Dial(Addr, grpc.WithInsecure())\n\n\tif err != nil {\n\t\tpp.Println(err)\n\t}\n\n\tdefer conn.Close()\n\n\t// 初始化客户端\n\tc := pb.NewWordFilterClient(conn)\n\n\t// 调用方法\n\tText := new(pb.Text)\n\tText.Text = `有了 gRPC， 我们可以一次性的在一个 .proto 文件中定义服务并使用任何支持它的操你妹语言去实现客户端和服务器，反过来，\n\t它们可以在各种环境中，你妈了个逼从Google的服务器到你自己的平板电脑—— gRPC 帮你解决了性吧春暖花开不同语言及环境间通信的复杂性.\n\t使用 protocol buffers 还能获得波多野结衣全集其他好处，包括高效的序列号，简单的 IDL 以及容易进行操你妈接口更新`\n\tr, err := c.FindKeyWords(context.Background(), Text)\n\tif err != nil {\n\t\tpp.Println(err)\n\t}\n\tpp.Println(r.KeyWords)\n```\n将会打印\n```\n[]*word_filter.KeyWord{\n  \u0026word_filter.KeyWord{\n    Word:    \"操你妹\",\n    Attr:    1,\n    Replace: \"我傻x\",\n  },\n  \u0026word_filter.KeyWord{\n    Word:    \"你妈了个逼\",\n    Attr:    2,\n    Replace: \"\",\n  },\n  \u0026word_filter.KeyWord{\n    Word:    \"性吧春暖花开\",\n    Attr:    1,\n    Replace: \"\",\n  },\n  \u0026word_filter.KeyWord{\n    Word:    \"波多野结衣全集\",\n    Attr:    1,\n    Replace: \"\",\n  },\n  \u0026word_filter.KeyWord{\n    Word:    \"操你妈\",\n    Attr:    1,\n    Replace: \"\",\n  },\n}\n\n```\n\n## 字典格式\n\n这里的字典格式指的是data目录下的txt的字典格式\n词典格式为文本格式：\n\n关键词|词性（可选，默认是替换词 1代表替换词，2代表审核词， 3代表禁止词）|替换词（可选）\n\n如:\n\n操你妈|1 //替换词\n\n你妈逼|1|你妹妹 //替换词\n\n卖毒品|3 //禁止词\n\n你妈了个逼|2 //审核词\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyuxlif%2Fgo-word-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyuxlif%2Fgo-word-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyuxlif%2Fgo-word-filter/lists"}