From daf4cd24553e64b3fb21cb56e53049aaf7531938 Mon Sep 17 00:00:00 2001 From: Lustre Date: Mon, 24 Jul 2017 12:33:32 +0800 Subject: [PATCH] Update README.md --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5eb5b9d..d9f220c 100644 --- a/README.md +++ b/README.md @@ -14,21 +14,25 @@ php实现基于确定有穷自动机算法的铭感词过滤 ...... ); +> 实例化敏感词过滤助手 + + $sensitiveWordHelper = Lib\SensitiveWordFilterHelper::init(); + > 构建敏感词hashMap //构建敏感词hashMap - $sensitiveWordMap = LSensitiveWordFilter::init()->setHashMap($wordData); + $sensitiveWordMap = $sensitiveWordHelper->setHashMap($wordData); > 敏感词过滤 //敏感词替换为***为例 - LSensitiveWordFilter::init()->replaceSensitiveWord($sensitiveWordMap, $content, '***'); + $filterContent = $sensitiveWordHelper->replaceSensitiveWord($sensitiveWordMap, $content, '***'); > 你也可以获取文字中的敏感词 //获取内容中所有的敏感词 - $sensitiveWordGroup = LSensitiveWordFilter::init()->getSensitiveWord($sensitiveWordMap, $content); + $sensitiveWordGroup = $sensitiveWordHelper->getSensitiveWord($sensitiveWordMap, $content); //仅且获取一个敏感词 - $sensitiveWordGroup = LSensitiveWordFilter::init()->getSensitiveWord($sensitiveWordMap, $content, 1); + $sensitiveWordGroup = $sensitiveWordHelper->getSensitiveWord($sensitiveWordMap, $content, 1); -*如果大家有更好的建议,请大家多多指正,O(∩_∩)O谢谢* \ No newline at end of file +*如果大家有更好的建议,请大家多多指正,O(∩_∩)O谢谢*