chenhuiji / sensitive-word-filter

天朝敏感词过滤🤓 支持替换敏感词,已收录1w+可自行添加

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sensitive-word-filter

NPM version Build Status Downloads

Introduction

A simple&basic text filter that is under censor of GFW, with DFA.

为nodejs提供的简单GFW敏感词过滤器,使用DFA实现。

Install

$ npm install sensitive-word-filter

Usage

var wc = require('sensitive-word-filter')
var string = "***大大,Ur so sexy babe!"
string = wc.filter(string) 
console.log(string) // ***大大,Ur so ***y babe!

If you want to add key words of your own, simply add them to the end of 'keywords' file, one word per line.

在'keywords'文件末尾增加自定义敏感词,每行一个。

Performance

Under 1ms for a 10-20 words sentence. Around 10ms for 1000 words.

10-20字的短句在1ms以内替换完成,1000字左右需要10ms左右

Thanks

Keyword list from https://github.com/observerss/textfilter

License

MIT

About

天朝敏感词过滤🤓 支持替换敏感词,已收录1w+可自行添加

License:MIT License


Languages

Language:JavaScript 100.0%