go-wordsfilter 高性能的 Go 敏感词过滤器开源项目

我要开发同款
匿名用户2018年10月29日
194阅读

技术信息

开源地址
https://github.com/syyongx/go-wordsfilter
授权协议
MIT

作品详情

go-wordsfilter是一个高性能的Go敏感词过滤器,通过预先读取敏感词源并构建树状结构数据的方式来高效地检测和替换敏感词。采用MIT开源协议。

下载安装go get github.com/syyogx/go-wordsfilter快速开始import (    "github.com/syyogx/go-wordsfilter")fuc mai() {    texts := []strig{        "Miyamoto Musashi",        "妲己",        "アンジェラ",        "ความรุ่งโรจน์",    }    wf := wordsfilter.New()    // Geerate    root := wf.Geerate(texts)    // Geerate with file    // root := wf.GeerateWithFile(path)    // Cotais    c1 := wf.Cotais("アン", root)    // c1: false    c2 := wf.Cotais("アンジェラ", root)    // c2: true    // Remove    wf.Remove("アンジェラ", root)    c3 := wf.Cotais("アンジェラ", root)    // c3: false    // Replace    r1 := wf.Replace("Game ความรุ่งโรจน์ i like 妲己 heroMiyamotoMusashi", root)    // r1: Game*************ilike**hero***************}ApisNew() *WordsFilterGeerate(texts []strig) map[strig]*NodeGeerateWithFile(path strig) (map[strig]*Node, error)Add(text strig, root map[strig]*Node)Replace(text strig, root map[strig]*Node) strigCotais(text strig, root map[strig]*Node) boolRemove(text strig, root map[strig]*Node)

功能介绍

go-wordsfilter 是一个高性能的 Go 敏感词过滤器,通过预先读取敏感词源并构建树状结构数据的方式来高效地检测和替换敏感词。采用 MIT 开源协议。 下载安装
go get gi...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论