Size: 646
Comment:
|
Size: 2359
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 23: | Line 23: |
需要编写一个针对技术文档翻译后的校对工作的小程序,不知各位能否给点建议。 * 我的需要是这样的: * 在进行翻译之前,发包方会提供一个中英对照的标准术语翻译表(放在 Excel 文件中),翻译人员在翻译文档时,如果遇到相应的术语,就要按照对方提供的术语表来翻译。 * 这个程序的作用就是预先识别出待翻译文档中的所有术语,并用特殊格式显示出文档中包含的术语,以便提醒翻译人员。 * 我在做法是这样的: 1. 把术语表读取出来,做成一个字典 textPair{},其中以英文术语作为键值,以中文翻译作为项值,即 textPair[En] = Ch。 1. 将待翻译文档中的内容,分割成一个一个句子(用翻译工具可以做到这个),然后将这些句子装入一个列表 transPair[] 中。 1. 然后: {{{ for term in textPair: for sentence in transPair: if term in sentence: do something }}} 但是,我发现这样做的效率很低,自己又没什么更好的方法,因此来这里看看,希望有高手能共同探讨一下。 === ZSP === {{{ 张沈鹏 <[email protected]> reply-to [email protected] to [email protected] date Mon, Mar 9, 2009 at 19:53 }}} 囧 英文的 很好办 * 虽然我有一个能牛XX的多模式匹配不过这里还用不到;just 改一下 循环 {{{ for sentence in transPair: result=[] for term in sentence.split(' '): if term in textPair: result.append("xxxxxxxxxxxxx") else: result.appned(term) print " ".join(result) }}} |
大数据集:频繁测试成员关系
题面儿
Roy Liu <[email protected]> reply-to [email protected] to [email protected] date Mon, Mar 9, 2009 at 19:28 subject [CPyUG:80888] 大数据集,频繁测试成员关系,各位有何建议
需要编写一个针对技术文档翻译后的校对工作的小程序,不知各位能否给点建议。
- 我的需要是这样的:
- 在进行翻译之前,发包方会提供一个中英对照的标准术语翻译表(放在 Excel 文件中),翻译人员在翻译文档时,如果遇到相应的术语,就要按照对方提供的术语表来翻译。
- 这个程序的作用就是预先识别出待翻译文档中的所有术语,并用特殊格式显示出文档中包含的术语,以便提醒翻译人员。
- 我在做法是这样的:
- 把术语表读取出来,做成一个字典 textPair{},其中以英文术语作为键值,以中文翻译作为项值,即 textPair[En] = Ch。
- 将待翻译文档中的内容,分割成一个一个句子(用翻译工具可以做到这个),然后将这些句子装入一个列表 transPair[] 中。
- 然后:
for term in textPair: for sentence in transPair: if term in sentence: do something
但是,我发现这样做的效率很低,自己又没什么更好的方法,因此来这里看看,希望有高手能共同探讨一下。
ZSP
张沈鹏 <[email protected]> reply-to [email protected] to [email protected] date Mon, Mar 9, 2009 at 19:53
囧 英文的 很好办
- 虽然我有一个能牛XX的多模式匹配不过这里还用不到;just 改一下 循环
for sentence in transPair: result=[] for term in sentence.split(' '): if term in textPair: result.append("xxxxxxxxxxxxx") else: result.appned(term) print " ".join(result)
反馈
创建 by -- ZoomQuiet [DateTime(2009-03-10T03:02:14Z)]