arcsecw / wubi Goto Github PK
View Code? Open in Web Editor NEWYou do not need to modify your model when applied it to Chinese,you can translate chinese chars to wubi ,then you can process chinese chars like english
License: MIT License
You do not need to modify your model when applied it to Chinese,you can translate chinese chars to wubi ,then you can process chinese chars like english
License: MIT License
我试了一下,感觉不大对
>>> import wubi
>>> wubi.get('不','cw')
u'i'
>>> wubi.get('下','cw')
u'gh'
不应该是对 'gi' 啊
The _compat
module is not found after installing through pip
(If it matters, I use python 3.6
).
I made a fork and fixed some bugs. I did remove python 2 support though, as dealing with all that unicode stuff was a pain. Let me know if this is an issue.
用测试文件跑了一下发现缺少确少了题目中的几个数据文件。
`
python w_trans.py --input test.txt --output result.txt --type 0
init __chinese_wubi dict ...
Traceback (most recent call last):
File "w_trans.py", line 135, in
main()
File "w_trans.py", line 130, in main
outfile = mapargs.type
File "w_trans.py", line 104, in chinese_wubi
self.__check_prepare(infile, type)
File "w_trans.py", line 34, in __check_prepare
self.__dict[type] = cPickle.load(open(type, 'r'))
IOError: [Errno 2] No such file or directory: '__chinese_wubi'
`
刚刚用提供的测试文件跑了一下
git clone [email protected]:arcsecw/chinese_wubi.git
cd chinese_wubi
python w_trans.py --i chinese.txt --o wubi.txt --t 0
输出的wubi.txt文件是一个与chinese.txt相同的文件,没有能转换成五笔码
还请check一下是不是存在这个问题
“去云”“万尤”“鉴览”“竞兑”“芜芫”“苟茗”“茄茴”“ynky”“fpgc”……
例子�很多,虽然对识别精确度的影响可能也不是很大。
不知道有没有考虑过把这些重码编上序号?
你好,我在python交互模式下跑了给出的代码
from w_trans import W_trans
m_trans = W_trans()
outputfile = m_trans.chinese_wubi('chinese.txt', 'chinese_wubi.txt')
得到的log是
init /__chinese_wubi dict ...
Traceback (most recent call last):
File "", line 1, in
File "w_trans.py", line 106, in chinese_wubi
self.__check_prepare(infile, type)
File "w_trans.py", line 36, in __check_prepare
self.__dict[type] = cPickle.load(open(type, 'r'))
IOError: [Errno 2] No such file or directory: '/__chinese_wubi'
还请check一下
print wubi.get('WenChaoWang爱自由','cw')
只能这样一句话一句话的转吗,想一次转整个文档,怎样做,谢谢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.