Comments (2)
@Touch-Night
我已经感受到了浓浓的论文论述气息,哈哈哈,respect。
一共三段,那我一段一段回复你哈。
第一段,“终究不能解决所有的存在此类问题”,说的对,偷懒只解决了主要矛盾,嘿嘿。但不好维护也是现实情况。
第二段,从 #139 获得 get_language_map
这个方法,辛苦了。其实后来增加了ts.get_language()
,可以更方便获取语言列表。
第三段,同第二段的回答。那我们就讨论一下怎么改进吧。
1、更新readme,之前是以google为标准,相同则为Y
,有但有差异Y(xxx)
,无则``。你可以去PR
它,并成为此仓库的贡献者。
2、你可以独立构建一个库,类似于chinesecalendar, 你的库将会成为我的依赖库。
3、直接优化PR此库,成为贡献者。方法:你可以将CSV转化为dict,并且要在代码内函数实现一键更新维护。且最后在翻译接口函数增加参数`alias_lang_if_detect=True`。
总之,感谢。期待你的回复。当然对于我的建议,你也可以对我说,“让我干?村口的驴子都不敢这么闲着!”
from translators.
此模块是我为text-generation-webui所写的插件more_translators所使用的。因此,我没有在supported_language_map.csv中包含所有的翻译器,而是仅仅包含了在我的设备和网络条件上可用的翻译器。此外,为了偷懒,我没有核对MyMemory的支持语言列表。
核对语言代码是费时费力的工作,它不能使用程序自动化完成。有不少翻译器没有使用ISO639,或是使用了ISO639的不同版本。不过好在大部分翻译器都在它们的翻译页面的html中包含了语言代码,我因此得以使用浏览器的审查元素功能核对。对于没有包含语言代码的翻译器,有时可以在其官方api文档里找到语言代码与语言名称的映射。以上都没有时,我只能查阅ISO639或是借助GPT。值得一提的是,必应为了保护濒危语言,支持了几个没有正式中文名的语言,对于这些语言,我在表格中自行翻译了它们的名称。
总之,supported_language_map.csv当前并不完整,这个表格最初是为了我的插件所制作的。放在这里仅能起到抛砖引玉的作用。因此目前直接把这个表格的内容放到此模块中应用,是不应该的。
关于Readme的更新,我相信除了获得支持语言代码字典的方法,还可能有其他的功能没有被添加到Readme中,我没有完整地阅读过源代码,因此也无法在Readme中写出所有新用法。
from translators.
Related Issues (20)
- [Feature]: Return the chosen language (handy when using 'auto') HOT 2
- [Bug]: "The `query_text` can't be empty!" in translate_html HOT 1
- [Bug]: workaround of consent.google.com doesn't work anymore HOT 11
- [Feature]: Translation services (eg Bing) easily rate limited HOT 1
- [Bug]: translator server - google: language map is empty so getting error "Unsupported from_language[ar] in []" HOT 24
- [Bug]: Python 3 doesn't like re with Positive Lookbehind ? HOT 2
- [Bug]: KeyError: 'data' when using baidu HOT 2
- [Bug]: "Using region <name> server backend." printed on stdout HOT 1
- [Feature]: Georgian language HOT 1
- [Bug]: translate_html strips whitespace HOT 1
- [Bug]: Misleading error message HOT 1
- [Bug]: iciba not working now HOT 2
- [Bug]: Unable to find server backend. HOT 1
- [Bug]: crash HOT 3
- [Bug]: The function baidu() has been not certified yet HOT 3
- [Bug]: 504 Server Error: Gateway Time-out for url: https://aidemo.youdao.com/trans HOT 2
- [Bug]: TypeError: 'NoneType' object is not subscriptable HOT 3
- [Bug]: 对省略号翻译的时候就会发生一些错误 HOT 5
- [Bug]: KeyError: 'target' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from translators.