- 授权协议: MIT
- 开发语言: Google Go
- 操作系统: 跨平台
- 软件首页: https://github.com/syyongx/go-wordsfilter
- 软件文档: http://www.syyong.com/Go/Go-wordsfilter-A-high-performance-Go-sensitive-word-filter.html
- 官方下载: https://github.com/syyongx/go-wordsfilter/releases
软件介绍
go-wordsfilter 是一个高性能的 Go 敏感词过滤器,通过预先读取敏感词源并构建树状结构数据的方式来高效地检测和替换敏感词。采用 MIT 开源协议。
下载安装
go get github.com/syyongx/go-wordsfilter
快速开始
import (
"github.com/syyongx/go-wordsfilter"
)
func main() {
texts := []string{
"Miyamoto Musashi",
"妲己",
"アンジェラ",
"ความรุ่งโรจน์",
}
wf := wordsfilter.New()
// Generate
root := wf.Generate(texts)
// Generate with file
// root := wf.GenerateWithFile(path)
// Contains
c1 := wf.Contains("アン", root)
// c1: false
c2 := wf.Contains("アンジェラ", root)
// c2: true
// Remove
wf.Remove("アンジェラ", root)
c3 := wf.Contains("アンジェラ", root)
// c3: false
// Replace
r1 := wf.Replace("Game ความรุ่งโรจน์ i like 妲己 heroMiyamotoMusashi", root)
// r1: Game*************ilike**hero***************
}Apis
New() *WordsFilter Generate(texts []string) map[string]*Node GenerateWithFile(path string) (map[string]*Node, error) Add(text string, root map[string]*Node) Replace(text string, root map[string]*Node) string Contains(text string, root map[string]*Node) bool Remove(text string, root map[string]*Node)
Dojo权威指南
拉塞尔 / 李松峰、李丽 / 机械工业出版社 / 2009-4 / 79.00元
通过使用Dojo这个工业强度的JavaScript工具箱,我们可以比使用其他任何Ajax框架更高效、更容易地创建JavaScript或Ajax驱动的应用程序和站点。 《Dojo权威指南》向读者展示了如何充分利用Dojo工具箱中包含的大量实用特性,以前所未有的效率开发出功能丰富、响应敏捷的Web应用程序。读者通过《Dojo权威指南》能够学习到创建复杂布局和表单控件(常见于高级桌面应用程序)的技......一起来看看 《Dojo权威指南》 这本书的介绍吧!
