Alternate URL: www.kdjingpai.com
Ctrl + D Favorites
Current Position:fig. beginning " AI Tool Library

sensitive-word: sensitive word filtering tool, efficient DFA algorithm implementation

2024-05-02 1.1 K

General Introduction

Sensitive word filtering tool (Sensitive Word) is a high-performance Java sensitive word filtering tool based on the implementation of the DFA algorithm framework. The tool can efficiently detect and filter sensitive words , support for multiple format conversion and custom replacement strategies. Its design goal is to provide an easy to use and superior performance of the sensitive word filtering solution for a variety of application scenarios .

 

 

Function List

  • Sensitive word detection: support sensitive word judgment, return, desensitization and other operations
  • Format Conversion: Support full- and half-corner conversion, traditional and simplified Chinese conversion, English case conversion, etc.
  • Customized Replacement: Support user-defined sensitive words and replacement strategies
  • Dynamic update: Support the dynamic update of the sensitive words database, real-time effective
  • Tag interface: support for tag management of sensitive words
  • Special Character Handling: Supports flexible matching by skipping special characters

 

 

Using Help

Installation process

  1. Preparing the environment: Ensure that JDK 1.8+ and Maven 3.x+ are installed.
  2. Introducing dependencies: In the project'spom.xmlfile to add the following dependencies:
    <dependency>
        <groupId>com.github.houbb</groupId>
        <artifactId>sensitive-word</artifactId>
        <version>0.19.2</version>
    </dependency>
    
  3. initialization: Initialize the SensitiveWordHelper class in the project.

 

Usage

  1. Sensitive word detection::
    String text = "待检测的文本内容";
    boolean contains = SensitiveWordHelper.contains(text);
    

    This method returns a boolean value indicating whether the text contains sensitive words.

  2. sensitive word replacement::
    String replacedText = SensitiveWordHelper.replace(text, '*');
    

    This method replaces sensitive words in the text with the specified characters.

  3. Get all sensitive words::
    List<String> sensitiveWords = SensitiveWordHelper.findAll(text);
    

    This method returns a list of all sensitive words in the text.

  4. Customized Sensitive Phrase Bank::
    SensitiveWordHelper.addSensitiveWord("自定义敏感词");
    

    This method allows users to dynamically add sensitive words.

 

Detailed Operation Procedure

  1. Initialize Sensitive Word Database: Load the default sensitive lexicon or a customized sensitive lexicon at project startup.
  2. text detection: In the text content that needs to be detected call theSensitiveWordHelper.containsmethod to determine if it contains sensitive words.
  3. sensitive word processing: Choose to use, based on business needs, thereplacemethod for sensitive word substitution, or use thefindAllmethod to get all the sensitive words for further processing.
  4. dynamic update (Internet): During operation, theaddSensitiveWordThe method dynamically updates the sensitive word database to ensure real-time and accurate detection of sensitive words.

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Scan the code to follow

qrcode

Contact Us

Top

en_USEnglish