Geek@Paris

Wiki for Mdict, do it yourself!

2006-08-01
昨天的方法有点问题,今天受教于2dx的指导,方法更正如下:
1: 先从http://download.wikimedia.org/网站上下载pages_articles.xml.bz2文件
2: 用WINRAR解压bz2文件,得到pages_articles.xml文件,记住一定要把文件名重命名为“pages_articles.xml”,是为了以后DOS下用命令行使用方便。
3: 将pages_articles.xml文件和Xml2sql放在同一目录下
4: 在开始->程序->附件,选择命令提示符(或者在运行中输入cmd),接下来就是写些基本的DOS操作指令,进入你的Xml2sql文件夹目录
5: 写命令:xml2sql pages_articles.xml NULL "-sqldump Ode.sql"(这一部很重要!!)
6: 数秒钟后得到de.sql,将其改名为cur_table.sql。
7: 这一部最关键!先要把冗余信息删除。打开cur_table.sql(建议使用UltraEdit,这样速度快),查找关键句“/*!40000 ALTER TABLE `cur` DISABLE KEYS */;”,一般都有2-4句(如果只有1句,就不用删除了),找到第一句和最后一句所在的位置,将这两句之间的内容全部删除,切记最后一句后面的内容不能删,那些内容就是我们要的主体部分,最后保存。
8:得到了标准的cur_table.sql,接下来就是用WikiToMDict制作wiki.txt。
________________
For foreign friends,look at here:
1,download the "pages_articles.xml.bz2" from "http://download.wikimedia.org"
2,get the "pages_articles.xml" from "pages_articles.xml.bz2"(if the xml file’s name is not "pages_articles.xml", rename it)
3,put "pages_articles.xml" file and "Xml2sql.exe" into the same directory
4,run "cmd",and change directory to the xml2sql.exe’s directory
5,type the following:xml2sql pages_articles.xml NULL "-sqldump Ode.sql"
6,at the same directory, you will get "de.sql" 
7,the most important step is: delete some redundant sentences. Open the sql file(It’s faster to use UltraEdit), find out“/*!40000 ALTER TABLE `cur` DISABLE KEYS */;”(if there is only one, don’t delete it), delete all the content between the first "/*!40000 ALTER TABLE `cur` DISABLE KEYS */;” and the last “/*!40000 ALTER TABLE `cur` DISABLE KEYS */;”, then save "de.sql".
8,now we get the standard "cur_table.sql", use "wiki2mdict.exe" to make *.txt file
Author:admin | Categories:PDA | Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *


Clickcha - The One-Click Captcha