星际译王(StarDict)词典格式分析备忘。

 

参照:http://code.google.com/p/babiloo/wiki/StarDict_format 
stardict词典格式分析  
xxxxx.dict or xxxxx.dict.dz 
xxxxx.idx or xxxxx.idx.gz 
xxxxx.ifo  
xxxxx.synoptional 
   
☆dict文件 
 词典最原始的数据文件,文件结构遵从ifo文件中的定  
 数据类型没有定义的时候,遵循以下结构 
 word_1_data_1_type; // a single char identifying the data type数据类型 一个字符
 word_1_data_1_data; // the data数据
 word_1_data_2_type;数据类型 一个字符
 word_1_data_2_data;数据
 ...... // the number of data entries for each word is determined by 
        // word_data_size in .idx file 
 word_2_data_1_type; 
 word_2_data_1_data; 
 ...... 
   
☆idx文件  
 词条的索引文件,按升序排序。 
 word_str;  // a utf-8 string terminated by '/0'.长度小于256,所收 单词
 word_data_offset;  // word data's offset in .dict file32bit or 63bit 无符号整数 网 序列
 word_data_size;  // word data's total size in .dict file  32-bit 无符号整数 网络字节序列
   
☆ifo文件  
 词典定义说明等描述文件。 
 version=   // required现在的官方解析软件只解析2.4.2和3.0.0
  拒绝读取替他版本。
  如果是3.0.0版本,会用到idxoffsetbits属性。
   
 bookname=      // required词典名称,必须项。
   
 wordcount=     // required词典收词数,idx中的总词数。注意不包括.syn中的词数
   
 synwordcount=  // required if ".syn" file exists.同义词词数,多用于日文中的假名等
   
 idxfilesize=   // required索引文件大小。为压缩前的大小。
   
 idxoffsetbits= // New in 3.0.0设定值为32或64。指定索引文件中 索引的 长度位数
   
 author= 
 email= 
 website= 
 description=    // You can use <br> for new line. 
 date= 
   
 sametypesequence= // very important. 
 e.g. 
 sametypesequence=W.dict数据文件全部由 .wav声音文件
 声音数据文件格式 所以,读取时可以直接忽略w 类型和长度
  按照idx文件中的数据长度读取即可。
  word_1_data
  word_2_data
  word_3_data
  ……
   
 sametypesequence=tmword_1_data_1_data + /0
 t: 标格式 word_1_data_2_data
 m:纯文本数据格式 word_2_data_1_data + /0
  word_2_data_2_data
   
☆syn文件  
 同义词定义文件。2.4.8以上版本支持  
 synonym_word;  // a utf-8 string terminated by '/0'.长度小于256,同义词词条单词
 original_word_index; // original word's index in .idx file.32bit,原词在索引文件中的位置
安装说明:http://blog.csdn.net/love254443233/article/details/39056173 安装说明: 1:sudo apt-get install stardict 2:全部解压到temp文件夹中 3:sudo mv temp/* /usr/share/stardict/dic 3:重启星际译王 包含的词库zh_CN 简体中文词典.html中所有汉语+英汉词库 cdict-gb dictionary(en - zh_CN) tarbal GPL, 4.5M, 57510 words stardict1.3 dictionary(en - zh_CN) tarbal GPL, 1.1M, 51214 words Sun Dict(en - zh_CN) tarbal GPL, 1M, 33042 words xdict-ec-gb dictionary(en - zh_CN) tarbal GPL, 3.6M, 177817 words xdict-ce-gb dictionary(zh_CN - en) tarbal GPL, 2.4M, 160995 words. cedict-gb dictionary(zh_CN - en) tarbal CEDICT LICENCE, 0.7M, 31200 words. 推荐! langdao-ec-gb dictionary(en - zh_CN) 朗道英汉字典 tarbal GPL, 9.1M, 435468 words. 推荐! langdao-ce-gb dictionary(zh_CN - en) 朗道汉英字典 tarbal GPL, 7.8M, 405719 words. 推荐! lazyworm-ec dictionary(en - zh_CN) 懒虫简明英汉词典 tarbal GPL, 10M, 452185 words. lazyworm-ce dictionary(zh_CN - en) 懒虫简明汉英词典 tarbal GPL, 1.7M, 119592 words. 新华字典 tarbal GPL, 8.9M, 74025 words. ProECCE dictionary 英汉汉英专业词典 tarbal GPL, 8.6M, 571998 words. Hanzi Master (zh_CN - en) tarbal GPL, 427K, 25992 words XiangYa Medical dictionary 湘雅医学专业词典 tarbal GPL, 28M, 1479322 words Advance Chinese big dictionary (zh_CN - zh_CN) 高级汉语大词典 tarbal GPL, 6.3M, 51675 words Advance Chinese big dictionary (zh_CN - zh_CN) 高级汉语大词典(修正版) tarbal GPL, 6.3M, 51675 words International standard Chinese big dictionary (zh_CN - zh_CN) 国际标准汉字大辞典 tarbal GPL, 1.5M, 45053 words Chinese idiom dictionary (zh_CN - zh_CN) 汉语成语词典 tarbal GPL, 2M, 24702 words Chinese idiom dictionary (zh_CN - zh_CN) 汉语成语词典(修正版) tarbal GPL, 1.9M, 13001 words 汉语成语词典(美化版) tarbal GPL, 2.8M, 13305 words Modern Chinese dictionary (zh_CN - zh_CN) 现代汉语词典 tarbal GPL, 3.3M, 57643 words Modern Chinese dictionary (zh_CN - zh_CN) 现代汉语词典(修正版) tarbal GPL, 3.2M, 57691 words 21 century bidirectional dictionary 21世纪英汉汉英双向词典 tarbal GPL, 13M, 213723 words quick_eng-zh_CN 英汉专业词典 tarball GPL, 10.7M, 634008 words 21 century bidirectional science and technology dictionary 21世纪双语科技词典 tarball GPL, 15M, 809486 words nc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值