Skip to content

敏感词过滤器。 es6,更健壮的异步方式,优化敏感词替换过程,优先替换长字符串。

License

Notifications You must be signed in to change notification settings

YSHIDM/text-censor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[![NPM Version][npm-image]][npm-url]

Introduction

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

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

Usage

let tc = require('./text-censor')

let { readFile } = require('fs').promises

let test = async string => { let replaceString = await tc.filter(string) console.log(replaceString) }

let _t = async () => {

  let string = await readFile('./测试文件.txt', 'utf-8')

  test(string)

}

_t()

test('邯郸T邯郸学院servants stepped in to remove t邯郸学步he body and began to wipe up the blo你好吗 on the 邯郸学习 ground. ')

About

敏感词过滤器。 es6,更健壮的异步方式,优化敏感词替换过程,优先替换长字符串。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%