Differences between revisions 3 and 4
Revision 3 as of 2009-03-10 03:04:07
Size: 646
Editor: ZoomQuiet
Comment:
Revision 4 as of 2009-03-10 03:04:29
Size: 3027
Editor: ZoomQuiet
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 改一下 循环
{{{#!python
for sentence in transPair:
  result=[]
  for term in sentence.split(' '):
       if term in textPair:
          result.append("xxxxxxxxxxxxx")
       else:
           result.appned(term)
   print " ".join(result)
}}}

==== 多模式匹配 ====
{{{
张沈鹏 <[email protected]>
reply-to [email protected]
to [email protected]
date Tue, Mar 10, 2009 at 07:33
}}}
算了 我还是扔出牛逼无比的多模式匹配吧

感谢伟大的redsea前辈,因为代码是他抠出来的:)

 建议::
  * 单个单词用我原来给的方法
  * 多个单词用多模式匹配
  * 这样效率最高

见附件: attachment:zspy.7z

 * 2.5应该可以用;其他的要自己编译一下
 * 当然,极度高效的做法是去改多模式匹配的封装 修改他的回调函数不过还是2-3次扫描比较快
 * attachment:多模式匹配算法简介.pdf

TableOfContents

Include(ZPyUGnav)

大数据集:频繁测试成员关系

题面儿

Roy Liu <[email protected]>
reply-to        [email protected]
to      [email protected]
date    Mon, Mar 9, 2009 at 19:28
subject [CPyUG:80888] 大数据集,频繁测试成员关系,各位有何建议

需要编写一个针对技术文档翻译后的校对工作的小程序,不知各位能否给点建议。

  • 我的需要是这样的:
    • 在进行翻译之前,发包方会提供一个中英对照的标准术语翻译表(放在 Excel 文件中),翻译人员在翻译文档时,如果遇到相应的术语,就要按照对方提供的术语表来翻译。
    • 这个程序的作用就是预先识别出待翻译文档中的所有术语,并用特殊格式显示出文档中包含的术语,以便提醒翻译人员。
  • 我在做法是这样的:
    1. 把术语表读取出来,做成一个字典 textPair{},其中以英文术语作为键值,以中文翻译作为项值,即 textPair[En] = Ch。
    2. 将待翻译文档中的内容,分割成一个一个句子(用翻译工具可以做到这个),然后将这些句子装入一个列表 transPair[] 中。
    3. 然后:

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 改一下 循环

   1 for sentence in transPair:
   2   result=[]
   3   for term in sentence.split(' '):
   4        if term in textPair:
   5           result.append("xxxxxxxxxxxxx")
   6        else:
   7            result.appned(term)
   8    print " ".join(result)

多模式匹配

张沈鹏 <[email protected]>
reply-to        [email protected]
to      [email protected]
date    Tue, Mar 10, 2009 at 07:33

算了 我还是扔出牛逼无比的多模式匹配吧

感谢伟大的redsea前辈,因为代码是他抠出来的:)

建议
  • 单个单词用我原来给的方法
  • 多个单词用多模式匹配
  • 这样效率最高

见附件: attachment:zspy.7z

  • 2.5应该可以用;其他的要自己编译一下
  • 当然,极度高效的做法是去改多模式匹配的封装 修改他的回调函数不过还是2-3次扫描比较快
  • attachment:多模式匹配算法简介.pdf


反馈

创建 by -- ZoomQuiet [DateTime(2009-03-10T03:02:14Z)]

PageComment2

[:/PageCommentData:PageCommentData]

MiscItems/2009-03-10 (last edited 2009-12-25 07:15:52 by localhost)