Skip to content

Latest commit

 

History

History
30 lines (17 loc) · 663 Bytes

Readme.md

File metadata and controls

30 lines (17 loc) · 663 Bytes

[![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. ')