Naphthalene Possum Management
    Wondering what’s next for npm?Check out our public roadmap! »

    word-filter-dfa

    0.0.5 • Public • Published

    sensitive-words-filter

    文字过滤,支持敏感词匹配,由DFA算法实现

    Install

    npm install sensitive-words-dfa-filter --save

    How to use

    let Filter = require('sensitive-words-dfa-filter');
     
    // 设定需要搜索的敏感字
    let search = [
      'f',
      'filter'
    ];
     
    // 初始化文字过滤器,将敏感字做成字典
    Filter.instance().init(search);
     
    // 运行
    console.log(Filter.instance().replace('This is filter word!')); // This is ****** word!
    console.log(Filter.instance().replace('This is fffffilterfffff word!')); // This is *************** word!

    Keywords

    none

    Install

    npm i word-filter-dfa

    DownloadsWeekly Downloads

    1

    Version

    0.0.5

    License

    MIT

    Unpacked Size

    8.79 kB

    Total Files

    8

    Last publish

    Collaborators

    • avatar