class Words

敏感词库

Constants

TYPE_CHECK

TYPE_WORDS

TYPE_REPLACE

Methods

setTree(array $data)

No description

bool
illegal(string $content)

是否非法

array
getIllegalWords()

获取敏感词

setSearchAllIllegal(bool $searchAllIllegal)

检测所有敏感词

string|string[]
replaceIllegalWords()

替换敏感词

static Words
instance()

No description

void
buildTree(string $words)

构建字典树

Details

at line 52
Words setTree(array $data)

No description

Parameters

array $data

Return Value

Words

Exceptions

DirectoryNotFoundException

at line 74
bool illegal(string $content)

是否非法

Parameters

string $content 内容

Return Value

bool

at line 99
array getIllegalWords()

获取敏感词

Return Value

array

at line 109
Words setSearchAllIllegal(bool $searchAllIllegal)

检测所有敏感词

Parameters

bool $searchAllIllegal 寻找所有敏感词

Return Value

Words

at line 120
string|string[] replaceIllegalWords()

替换敏感词

Return Value

string|string[]

at line 132
static Words instance()

No description

Return Value

Words

at line 145
protected void buildTree(string $words)

构建字典树

Parameters

string $words 词汇

Return Value

void