forked from xiaohigh/phpanalysis
-
Notifications
You must be signed in to change notification settings - Fork 3
/
dict_build.php
32 lines (30 loc) · 1 KB
/
dict_build.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
//编译词库
ini_set('memory_limit', '128M');
error_reporting(E_ALL);
header('Content-Type: text/html; charset=utf-8');
require_once('phpanalysis.class.php');
$dicAddon = dirname(__FILE__).'/dict/not-build/base_dic_full.txt';
if( empty($_GET['ac']) )
{
echo "<div style='line-height:28px;'>请选择要进行的操作:<br />";
echo "1、<a href='?ac=make'>用原始文件(dict/not-build/base_dic_full.txt)生成一个标准词典;</a><br />";
echo "2、<a href='?ac=revert'>从默认词典(dict/base_dic_full.dic),反编译出原始文件。</a></div>";
exit();
}
if( $_GET['ac']=='make' )
{
PhpAnalysis::$loadInit = false;
$pa = new PhpAnalysis('utf-8', 'utf-8', false);
$pa->MakeDict( $dicAddon );
echo "完成词典创建!";
exit();
}
else
{
$pa = new PhpAnalysis('utf-8', 'utf-8', true);
$pa->ExportDict('base_dic_source.txt');
echo "完成反编译词典文件,生成的文件为:base_dic_source.txt !";
exit();
}
?>