|
[特别发布] 纯PHP编写的xdb词典导入导出工具!!
|
|
2009-07-01, 05:21 PM
帖数: #1
|
|||
|
|||
|
纯PHP编写的xdb词典(SCWS - http://www.ftphp.com/scws 所采用)导入导出工具!!
1. 词典导出:dump_xdb_file.php 在命令行模式下运行 php dump_xdb_file.php <要导出的.xdb文件> [存入的文本文件] 第二参数省略则直接输出到标准输出。 2. 词典生成:make_xdb_file.php 同样是在命令行模式下运行(需要安装 mbstring 扩展) 默认是处理 gbk 编码的文本,如果你的文本是 utf8,则需要修改该程序的第一行,把 define('IS_UTF8_TXT', false); 改为 true php make_xdb_file.php <要生成的.xdb> [导入的文本文件] --- 关于文本文件的说明,每行一条记录,#开头表示注释,每条记录由 word、TF、IDF、Attr组成,其中TF是词频系数,IDF是逆词频率系数 而Attr是北大标注法的词性,这四个字段之间用\t隔开。 --- hightman 特别制作于 2009.7.1 下载地址:http://www.ftphp.com/scws 或 http://www.hightman.cn/bbs 的 scws 版 |
|||
|
2009-07-05, 09:52 AM
(这个帖子最后修改于: 2009-07-05 10:43 AM by heraldboy.)
帖数: #2
|
|||
|
|||
|
RE: [特别发布] 纯PHP编写的xdb词典导入导出工具!!
非常兴奋!
今天上来网站看,发现你已经做好了这个工具,还没测试,先赞一下。 站长真是给人意外惊喜,马上试试先。 发现以下错误,不过应该没有大问题,另我不是在命令行方式执行的: Notice: Undefined variable: mask in C:\wamp\www\pscws4\etc\xdb.class.php on line 138 Warning: fread() [function.fread]: Length parameter must be greater than 0 in C:\wamp\www\pscws4\etc\xdb.class.php on line 612 Warning: unpack() [function.unpack]: Type I: not enough input, need 4, have 0 in C:\wamp\www\pscws4\etc\xdb.class.php on line 613 Notice: Undefined index: klen in C:\wamp\www\pscws4\etc\xdb.class.php on line 633 Notice: Undefined index: klen in C:\wamp\www\pscws4\etc\xdb.class.php on line 634 Warning: fread() [function.fread]: Length parameter must be greater than 0 in C:\wamp\www\pscws4\etc\xdb.class.php on line 638 Notice: Undefined index: llen in C:\wamp\www\pscws4\etc\xdb.class.php on line 322 Notice: Undefined index: rlen in C:\wamp\www\pscws4\etc\xdb.class.php on line 327 Warning: unpack() [function.unpack]: Type I: not enough input, need 4, have 0 in C:\wamp\www\pscws4\etc\xdb.class.php on line 613 Notice: Undefined index: klen in C:\wamp\www\pscws4\etc\xdb.class.php on line 633 Notice: Undefined index: klen in C:\wamp\www\pscws4\etc\xdb.class.php on line 634 Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 1642825009 bytes) in C:\wamp\www\pscws4\etc\xdb.class.php on line 638 我这台电脑只有512M,是不是这个原因呢? 生成字典时,发现mbstring exteions没有装好,搞了半天都没有装上,正研究中... |
|||
|
2009-07-05, 12:52 PM
(这个帖子最后修改于: 2009-07-05 12:52 PM by hightman.)
帖数: #3
|
|||
|
|||
|
RE: [特别发布] 纯PHP编写的xdb词典导入导出工具!!
可能你的词典文件错误或被篡改过导致的错误吧. 不然不会有这么多的内存需求.
|
|||
|
2009-07-18, 05:22 PM
帖数: #4
|
|||
|
|||
|
RE: [特别发布] 纯PHP编写的xdb词典导入导出工具!!
Notice: Undefined variable: mask in C:\wamp\www\pscws4\etc\xdb.class.php on line 138
Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 1642825009 bytes) in C:\wamp\www\pscws4\etc\xdb.class.php on line 638 这两个问题我试过多次,还是有的,麻烦站长看看,内存不够的问题到底是什么原因啊。 |
|||
|
2009-07-18, 05:37 PM
帖数: #5
|
|||
|
|||
RE: [特别发布] 纯PHP编写的xdb词典导入导出工具!!
(2009-07-18 05:22 PM)heraldboy 提到: Notice: Undefined variable: mask in C:\wamp\www\pscws4\etc\xdb.class.php on line 138 把 xdb.class.php Line 138 的 $mask 改成 $prime |
|||
|
|
| 可能相关的主题... | |||||
| 主题: | 作者 | 回复数: | 人气: | 最近发表 | |
| [特别提供] 纯PHP编写的sqlite词典工具!! | limaoxiang | 5 | 2,726 |
2010-07-08 01:33 PM 最近发表: hightman |
|
| 求一个txt版的dict.xdb词典 | dreamhunter | 0 | 1,050 |
2010-03-18 04:02 PM 最近发表: dreamhunter |
|
| 发布scws-1.1.1 修正内存泄露的bug(同时修复php的xdb导入导出) | hightman | 0 | 1,720 |
2010-03-04 06:56 PM 最近发表: hightman |
|

搜索
会员列表
日历
帮助


