Uses of Class
org.miaixz.bus.core.text.dfa.FoundWord
Packages that use FoundWord
Package
Description
DFA全称为:Deterministic Finite Automaton,即确定有穷自动机 用所有关键字构造一棵树,然后用正文遍历这棵树,遍历到叶子节点即表示文章中存在这个关键字。
我们暂且忽略构建关键词树的时间,每次查找正文只需要O(n)复杂度就可以搞定。
-
Uses of FoundWord in org.miaixz.bus.core.text.dfa
Methods in org.miaixz.bus.core.text.dfa that return FoundWordModifier and TypeMethodDescriptionstatic FoundWordSensitive.getFoundFirstSensitive(String text) 查找敏感词,返回找到的第一个敏感词获得第一个匹配的关键字Methods in org.miaixz.bus.core.text.dfa that return types with arguments of type FoundWordModifier and TypeMethodDescriptionSensitive.getFoundAllSensitive(String text) 查找敏感词,返回找到的所有敏感词Sensitive.getFoundAllSensitive(String text, boolean isDensityMatch, boolean isGreedMatch) 查找敏感词,返回找到的所有敏感词 密集匹配原则:假如关键词有 ab,b,文本是abab,将匹配 [ab,b,ab] 贪婪匹配(最长匹配)原则:假如关键字a,ab,最长匹配将匹配[a, ab]WordTree.matchAllWords(String text) 找出所有匹配的关键字WordTree.matchAllWords(String text, int limit) 找出所有匹配的关键字WordTree.matchAllWords(String text, int limit, boolean isDensityMatch, boolean isGreedMatch) 找出所有匹配的关键字Methods in org.miaixz.bus.core.text.dfa with parameters of type FoundWord