Package | Description |
---|---|
cn.hutool.dfa |
DFA全称为:Deterministic Finite Automaton,即确定有穷自动机。
|
Modifier and Type | Method and Description |
---|---|
static FoundWord |
SensitiveUtil.getFoundFirstSensitive(Object obj)
查找敏感词,返回找到的第一个敏感词
|
static FoundWord |
SensitiveUtil.getFoundFirstSensitive(String text)
查找敏感词,返回找到的第一个敏感词
|
FoundWord |
WordTree.matchWord(String text)
获得第一个匹配的关键字
|
Modifier and Type | Method and Description |
---|---|
static List<FoundWord> |
SensitiveUtil.getFoundAllSensitive(Object bean)
查找敏感词,返回找到的所有敏感词
|
static List<FoundWord> |
SensitiveUtil.getFoundAllSensitive(Object bean,
boolean isDensityMatch,
boolean isGreedMatch)
查找敏感词,返回找到的所有敏感词
密集匹配原则:假如关键词有 ab,b,文本是abab,将匹配 [ab,b,ab] 贪婪匹配(最长匹配)原则:假如关键字a,ab,最长匹配将匹配[a, ab] |
static List<FoundWord> |
SensitiveUtil.getFoundAllSensitive(String text)
查找敏感词,返回找到的所有敏感词
|
static List<FoundWord> |
SensitiveUtil.getFoundAllSensitive(String text,
boolean isDensityMatch,
boolean isGreedMatch)
查找敏感词,返回找到的所有敏感词
密集匹配原则:假如关键词有 ab,b,文本是abab,将匹配 [ab,b,ab] 贪婪匹配(最长匹配)原则:假如关键字a,ab,最长匹配将匹配[a, ab] |
List<FoundWord> |
WordTree.matchAllWords(String text)
找出所有匹配的关键字
|
List<FoundWord> |
WordTree.matchAllWords(String text,
int limit)
找出所有匹配的关键字
|
List<FoundWord> |
WordTree.matchAllWords(String text,
int limit,
boolean isDensityMatch,
boolean isGreedMatch)
找出所有匹配的关键字
密集匹配原则:假如关键词有 ab,b,文本是abab,将匹配 [ab,b,ab] 贪婪匹配(最长匹配)原则:假如关键字a,ab,最长匹配将匹配[a, ab] |
Modifier and Type | Method and Description |
---|---|
default String |
SensitiveProcessor.process(FoundWord foundWord)
敏感词过滤处理
|
Copyright © 2024. All rights reserved.