Skip to content

简单的用作扩展去分析敏感词,参考了https://github.com/wear/harmonious_dictionary 该gem的对敏感词做成哈希词库的代码,把一些不需要的代码进行了删除

Notifications You must be signed in to change notification settings

nbyun/harmonious_dictionary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

和谐宝典,在原有的基础上进行了削减不需要的功能

*使用方法:

Padrino框架下

gem 'harmonious_dictionary', git: 'https://github.com/nbyun/harmonious_dictionary.git'

再往项目中的config文件夹下新增harmonious_dictionary文件夹,往其增加两个文件chinese_dictionary.txt和english_dictionary.txt,一个是中文敏感词库,一个是英文敏感词库

上述步骤完成后,在Rakefile中添加require 'harmonious_dictionary'

然后执行rake harmonious_dictionary:generate,此时词库已经初始化成功,可以进入使用了!

  • 检查输入是否包含敏感词 HarmoniousDictionary.clean?(your_input)
  • 检查包含的敏感词 HarmoniousDictionary.harmonious_words(your_input)
  • 替换包含的敏感词为* HarmoniousDictionary.clean(your_input)

Rails框架下

#TODO

About

简单的用作扩展去分析敏感词,参考了https://github.com/wear/harmonious_dictionary 该gem的对敏感词做成哈希词库的代码,把一些不需要的代码进行了删除

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages