public abstract class WordCheckInit extends Object implements IWordCheck
| 构造器和说明 |
|---|
WordCheckInit() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected abstract void |
init(com.github.houbb.heaven.support.pipeline.Pipeline<IWordCheck> pipeline)
初始化列表
|
WordCheckResult |
sensitiveCheck(int beginIndex,
InnerSensitiveWordContext checkContext)
检查敏感词数量
(1)如果未命中敏感词,直接返回 0
(2)命中敏感词,则返回敏感词的长度。
|
protected abstract void init(com.github.houbb.heaven.support.pipeline.Pipeline<IWordCheck> pipeline)
pipeline - 当前列表泳道public WordCheckResult sensitiveCheck(int beginIndex, InnerSensitiveWordContext checkContext)
IWordCheck(1)如果未命中敏感词,直接返回 0 (2)命中敏感词,则返回敏感词的长度。
ps: 这里结果进行优化, 1. 是否包含敏感词。 2. 敏感词的长度 3. 正常走过字段的长度(便于后期替换优化,避免不必要的循环重复)
sensitiveCheck 在接口中 IWordCheckbeginIndex - 开始下标checkContext - 执行上下文Copyright © 2025. All rights reserved.