Giter VIP home page Giter VIP logo

sensitive's Issues

语句末尾字符会被错误的替换

代码:
fmt.Println(filter.Replace("hello", 42))
fmt.Println(filter.Replace("hello world", 42))
fmt.Println(filter.Replace("人", 42))
fmt.Println(filter.Replace("不办人事 人", 42))

输出结果:
hell*
hello worl*
*


如何释放一个Trim树,重新载入

功能:程序初始化载入到word,后续请求使用word这个指针直接处理即可。但又需要定时刷新词库,但如果重新AddWord会导致内存上涨,如何先释放后重新addWord

可以支持过滤含noise的文本吗?

package wordpackage_test

import (
	"github.com/importcjj/sensitive"
	"testing"
)

// 范例
func TestFilterExample(t *testing.T) {
	filter := sensitive.New()
	filter.AddWord("这句话应被屏蔽")

	actual := filter.Replace("这 句 话 应 被 屏 蔽", '*')
	expect := "*******"
	if actual != expect {
		t.Error("屏蔽失败")
	}
}

上方是测试用例,过滤语句中如果含noise,会导致替换失败,目前还不支持测试用例里的这种用法,可以加入支持吗?

LoadWordDict无法加载文件

open ../dict/dict.txt: The system cannot find the path specified.

很奇怪的一件事,无法加载显示ioutil.ReadFile(path)这里出错,但是我自己重新写了一个加载文件的方法,采用绝对路径,可以加载成功,不知道问题出在哪里

关键词过滤问题

你的这个库在本地环境使用关键字过滤是正常的,放到服务器的时候就用不了
服务上使用关键查询不管输入什么内容 都是匹配关键字成功 可是匹配出来的关键字是空

A more serious readme is required

Hello,

Your project is great, the code is easy to understand and use, however, the ReadMe of this project seems to be funny but not that professional.

I want to use this lib but a little worried about Code Review. Are you guys considering make an Readme/doc for all users from many other countries?

Thanks for your hard work, it helps a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.