# sensitive-word **Repository Path**: cxxFFrank/sensitive-word ## Basic Information - **Project Name**: sensitive-word - **Description**: 基于java的三种敏感词工具类 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2019-07-30 - **Last Updated**: 2024-01-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: 工具 ## README # sensitive-word #### 介绍 基于java的三种敏感词工具类 #### 使用说明 1. 基于java的三种过滤敏感词的工具类,每个工具类都有测试 基于java的三种过滤敏感词的工具类,每个工具类都有测试 DFA算法 首先构建敏感词库,该词库名称为SensitiveMap,这两个词的二叉树构造为: 日--> 本 -->人 ! ! 鬼 1、在hashMap中查询“日”看其是否在hashMap中存在,如果不存在,则证明已“日”开头的敏感词还不存在,则我们直接构建这样的一棵树。 跳至3。 2、如果在hashMap中查找到了,表明存在以“日”开头的敏感词,设置hashMap = hashMap.get(“日”),跳至1,依次匹配“本”、“人”。 3、判断该字是否为该词中的最后一个字。若是表示敏感词结束,设置标志位isEnd = 1,否则设置标志位isEnd = 0;