翻译机
来源:互联网 发布:biz cc 域名 哪个好 编辑:程序博客网 时间:2024/06/07 03:22
Dict = { 'i':u'我','my':u'我的','is':u'是', 'name':u'名字','that':u'这','hello':u'大家好', 'guys':u'伙伴们', 'like':u'喜欢', 'computer':u'计算机', 'graphic':u'图形图像','especially':u'尤其是', 'vfx':u'视觉特效','loli':u'萝莉', 'life':u'生活','lambert':u'兰伯特'}Text = '''Hello guysMy name is LambertI like computer graphic especially VFXI like LOLIThat is my life'''def translateMachine(word): convert = word.lower() if convert not in Dict: return word return Dict[convert]def translateSentence(sentence): wordsInSentence = sentence.split(' ') chineseSentence = '' for i in wordsInSentence: chineseSentence +=translateMachine(i) return chineseSentencedef translateText(text): sentencesInText =text.split('\n') chineseText = '' for j in sentencesInText: chineseText += translateSentence(j) chineseText += '\n' return chineseTextprint(translateText(Text))
0 0
- 翻译机
- 程序设计:百度语言翻译机
- 百度语言翻译机
- 百度语言翻译机
- 百度语言翻译机
- 百度语言翻译机
- ACM1、百度语言翻译机
- 哈希法求解百度语言翻译机
- 百度之星编程大赛--百度语言翻译机(解答)
- 百度之星编程大赛-语言翻译机(C#解答)
- 算法小记02--学习Python之百度语言翻译机
- 解释器模式--自定义语言翻译机(行为模式03)
- 【python】利用http的POST请求实现自动翻译机
- 利用Google在线翻译引擎制作自己的多国语言翻译机
- 利用Google在线翻译引擎制作自己的多国语言翻译机
- 2006年百度之星程序设计大赛试题初赛题目-题6-百度语言翻译机
- 2006 年百度之星程序设计大赛初赛题目 6 百度语言翻译机
- 2006 年百度之星程序设计大赛初赛题目 6 百度语言翻译机
- 若干字符串后缀函数
- cocos2d-x 图层触摸事件处理onTouch-----沈大海
- ASP.NET~常用内置对象
- VC++创建一个自定义桌面图标
- SQL注入
- 翻译机
- 牛腩新闻发布 & 点击回车键无响应,与数据库无连接
- B/S VS C/S
- 生活的大门向你敞开……
- iOS:枚举和位运算
- 操作系统知识
- OO模式-Composite
- OO模式-Singleton
- 图 深度优先遍历(DFS)