-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fb1296
commit e522a9a
Showing
5 changed files
with
88 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/** | ||
* Class PdsBusinessException | ||
* User: Lustre | ||
* Date: 2018/9/20 | ||
* Time: 下午9:16 | ||
*/ | ||
|
||
namespace DfaFilter\Exceptions; | ||
|
||
use Exception; | ||
|
||
class PdsBusinessException extends Exception | ||
{ | ||
const EMPTY_CONTENT = 10001; // 空检测文本内容 | ||
const EMPTY_WORD_POOL = 10002; // 空词库 | ||
const CANNOT_FIND_FILE = 10003; // 找不到词库文件 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/** | ||
* Class PdsSystemException | ||
* User: wanghui | ||
* Date: 2018/9/20 | ||
* Time: 下午9:39 | ||
*/ | ||
|
||
namespace DfaFilter\Exceptions; | ||
|
||
use Exception; | ||
|
||
class PdsSystemException extends Exception | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
namespace DfaFilter; | ||
|
||
use DfaFilter\Exceptions\PdsSystemException; | ||
|
||
/** | ||
* @param $str | ||
* @param null $encoding | ||
* | ||
* @return int | ||
* @throws \DfaFilter\Exceptions\PdsSystemException | ||
*/ | ||
function mb_strlen($str, $encoding = null) | ||
{ | ||
$length = \mb_strlen($str, $encoding); | ||
if ($length === false) { | ||
throw new PdsSystemException(' encoding 无效'); | ||
} | ||
|
||
return $length; | ||
} |