关于perl的几个问题,感谢回答。

next if ($file=~/dealigner\.pl/i)
这个里面的i 是代表 “无限和无数”吗?

$line=substr ($line, 13);

这个怎么解读?

s/ +/ /g

这个什么意思?

不好意思,刚刚接触,问的比较。。。感谢回答。
 
回复: 关于perl的几个问题,感谢回答。

1) i means case insensitive - telling perl to ignore cases

2) revise the line by removing the first 13 characters of the line

3) replace all instances of more than one ASCII white spaces with just one white space
 
回复: 关于perl的几个问题,感谢回答。

感谢您的回复。

if ($line=~/\<Seg L\=EN/)
{
$line=substr ($line, 13);
明白了,谢谢哈。
 
Last edited:
回复: 关于perl的几个问题,感谢回答。

This was a program I wrote to extract English and Chinese texts from Trados translation Memory into separate files.

If a line contains the character string "<Seg L =EN", then remove the first 13 characters of the line (and write the remainder of the line into the file for the English text - another command);

If a line contains the character string "<Seg L =CN", then remove the first 13 characters of the line (and write the remainder of the line into the file for the Chinese text - another command).

So the following two lines in the translation memory

<Seg L=EN-GB><P><S>CHAPTER XXVI</S></P>
<Seg L=ZH-CN><P><S>???????ù??</S></P>

will become

<P><S>CHAPTER XXVI</S></P>
<P><S>???????ù??</S></P>

and they are written into separate files.

That's what I called "de-alignment"...
 
回复: 关于perl的几个问题,感谢回答。

This was a program I wrote to extract English and Chinese texts from Trados translation Memory into separate files.

If a line contains the character string "<Seg L =EN", then remove the first 13 characters of the line (and write the remainder of the line into the file for the English text - another command);

If a line contains the character string "<Seg L =CN", then remove the first 13 characters of the line (and write the remainder of the line into the file for the Chinese text - another command).

So the following two lines in the translation memory

<Seg L=EN-GB><P><S>CHAPTER XXVI</S></P>
<Seg L=ZH-CN><P><S>???????ù??</S></

will become

<P><S>CHAPTER XXVI</S></P>
<P><S>???????ù??</S></P>

and they are written into separate files.

That's what I called "de-alignment"...

thank you so much, how detailed explanation. Really help full for me. Thank you so much
 
Back
顶部