GithubHelp home page GithubHelp logo

xiaochangbai / sensitive-hunter Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 998 KB

全网最强的敏感词处理工具包, 基于DFA 算法,收录16W+词汇,数据压缩

License: Apache License 2.0

Java 100.00%
dfa sensitive nlp sensit sensitive-word sensitivity-analysis trie-tree

sensitive-hunter's Introduction

Sensitive Hunter

Sensitive Hunter 敏感的猎人 全网最强的敏感词处理工具包.

在线体验

IChat:利用Sensitive Hunter来过滤聊天的过程中出现的一些敏感词语

特性

  • 基于 DFA 算法构建,数据占用空间小,检索更快
  • 系统内置敏感词库收录接近16W+,且不断优化更新
  • 数据压缩,支持从海量压缩文件中读取数据词典
  • 使用简单快捷,支持高度定制化

快速开始

1) 在pom文件中引入依赖:

    <dependency>
        <groupId>io.xiaochangbai.sensitive</groupId>
        <artifactId>sensitive-hunter-core</artifactId>
        <version>${last-version}</version>
    </dependency>

2) 将对象注入到Spring容器中:

    @Bean
    public SWDispatcher sWDispatcher(){
        SensitiveWordConfig sensitiveWordConfig = SensitiveWordConfig.defaultConfig();
        return SensitiveWordDispatcher.newInstance(sensitiveWordConfig);
    }

3) 在需要用到的使用即可:

    @Autowired
    private SWDispatcher sWDispatcher;

    @Test
    public void test(){
        String text = "我爱中华,中华爱我";
        //将语句中的敏感词替换成指定内容
        sWDispatcher.replace(text,'*');

        //查看语句中是否包含敏感词
        sWDispatcher.contains(text);
    }

sensitive-hunter's People

Contributors

xiaochangbai avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

zhiqinzhe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.