赞 | 93 |
VIP | 0 |
好人卡 | 13 |
积分 | 80 |
经验 | 53314 |
最后登录 | 2024-8-13 |
在线时间 | 1183 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 7981
- 在线时间
- 1183 小时
- 注册时间
- 2007-7-29
- 帖子
- 2055
|
自行编辑转档后的字库吧。
字库 => txt 脚本
- word_cabin = File.open("CnWordCabin.fonc","rb")
- @cn_key = Marshal.load(word_cabin)
- @cn_word = Marshal.load(word_cabin)
- f = File.open("list.txt", "w")
- @cn_word.each do |pair|
- key = pair[0]
- f << key
- f << "\n"
- list = pair[1]
- list.each do |str|
- f << str
- f << ","
- end
- f << "\n"
- end
- f.close()
复制代码
txt =>字库脚本
- src = File.open("list.txt","rb")
- txt = src.read
- line = txt.split(/\r?\n/)
- key = []
- hash = {}
- for i in 0...line.count
- if (i % 2 == 1)
- next
- end
- py = line[i]
- list = line[i+1].split(",")
- list.delete("")
- key.push(py)
- hash[key] = list
- end
- n = File.new("NewCnWordCabin.fonc", "w")
- Marshal.dump(key, n)
- Marshal.dump(hash, n)
- n.close()
复制代码 |
评分
-
查看全部评分
|