gumblex / zhconv Goto Github PK
View Code? Open in Web Editor NEWSimple conversion and localization between simplified and traditional Chinese using tables from MediaWiki.
Home Page: https://pypi.python.org/pypi/zhconv
License: MIT License
Simple conversion and localization between simplified and traditional Chinese using tables from MediaWiki.
Home Page: https://pypi.python.org/pypi/zhconv
License: MIT License
具体路径应该是\includes\languages\data\ZhConversion.php
MediaWiki 的代码是 GPL 的,他的转换词典有通过其他协议释出的版本吗?如果没有的话 MIT 协议的项目应该没法用他的词典。
convert_for_mw('[[𨭎|-{zh-cn:-{钅}-<span style="position: relative; left: -1ex">-{喜}-</span>; zh-tw:𨭎; zh-hk:𨭎;}-]]', "zh-cn")
This text above will raise a keyError, and you can get this page from https://zh.wikipedia.org/wiki/%E9%92%A8
https://pypi.org/project/zhconv/1.4.0/#description
这里我试了半天,不知道怎么输入命令执行
python -mzhconv [-w] {zh-cn|zh-tw|zh-hk|zh-sg|zh-hans|zh-hant|zh} < input > output
我试过以下命令,怎么用都是错的
python3 -mzhconv -w zh-cn ./tc/ ./out
python3 -mzhconv -zh-cn ./tc ./out
python3 -mzhconv zh-cn ./tc ./out
我以此事颇有意思,欲为纯浏览器本者,并加之级段落启发式模板,卿可议开源许我做这衍生本乎?
(我觉得这个工作很有意思,想做一个纯浏览器的版本,并加入一些段落级的启发式模板,你的开源协议可以允许我做这样的衍生版本吗?)
老王,你的古文翻译功能,能给个接口不
爬取小说通过OpenCC简繁转换,但实在太慢了。不知道这个速度怎么样?
Because return the not actually converted sentence may confuse someone that is careless about the supported locales.
And I think raise an error early can stop future big error for user codes.
Lines 235 to 254 in 078838e
Let's see a mistake that may confuse the users in using the locale:
inputs = "我幹什麼不干你事"
print(convert(temp, locale='zh_cn'))
#output the same as the inputs but no warnings or erros
Maybe many users like me use zh_cn
instead of the correct zh_cn
by mistake sometime.
C:\pv\tts\lib\site-packages\zhconv\zhconv.py:33: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import resource_stream
..\..\..\..\..\pv\tts\lib\site-packages\pkg_resources\__init__.py:2868
..\..\..\..\..\pv\tts\lib\site-packages\pkg_resources\__init__.py:2868
..\..\..\..\..\pv\tts\lib\site-packages\pkg_resources\__init__.py:2868
..\..\..\..\..\pv\tts\lib\site-packages\pkg_resources\__init__.py:2868
C:\pv\tts\lib\site-packages\pkg_resources\__init__.py:2868: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
rt,是否有一定不会出现字数变化的模式?
应该是zhcdit.json中定义了"么小"这个词。我现在的处理方式是将zhcdict.json拷出来,在"么小"前添加"为什么",然后启动时手动load_dict
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.