Skip to content

Commit

Permalink
todo change string to unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
wujunwei committed Nov 13, 2017
1 parent fae722e commit 7f9bf89
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Tool/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ static public function createFromFile($filePath)
foreach ($words as $word){
buildNode($root, mbStrSplit($word));
}
echo json_encode($root);
//init double-array trie
$base[0] = 1;
$check[0] = 0;
}

static public function updateFromFile($filePath, $trie)
Expand Down
2 changes: 1 addition & 1 deletion src/Tool/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function getSensitiveFromFile($filePath)
function buildNode(&$node, $chars, $i = 0)
{
if($i < count($chars)){
$char = $chars[$i];
$char = $chars[$i];
if (!isset($node[$char])){
$node[$char] = [];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Tool/test.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rewr,rd,relove, 我爱你,我想你
rewr,rd, 我爱你,relove,我想你

0 comments on commit 7f9bf89

Please sign in to comment.