Thanks Daniel and Tomas.

I solved the issue with a PHP script as following. The solution is
like Daniel's, to delete the blank space in the placeholders. The
result is that the placeholder is treated as a whole in decoding
process. I executed the script just before running decoding.

<?php

$fp = fopen("true.en", "r");
$fo = fopen("out_compacted.en", "w");

while ($line = fgets($fp)) {
  $line = preg_replace('/\{ \}/', '{}', $line);
  fputs($fo, $line);
}

fclose($fp);
fclose($fo);


Thanks,
Henry


On Tue, Jul 10, 2012 at 2:55 PM, Tomas Hudik <[email protected]> wrote:
> Hi Henry,
> This answer is coming late probably, but:
>
> We have developed small sw for placeholder translation.
> It is under the same license as Moses.
> http://code.google.com/p/m4loc/
> If you want to try it - download sources (it is perl mostly, so you do not 
> need to compile it). The input should be tmx, or xliff file (localization 
> file formats).
> Be aware results won't be 100% correct.
>
>
> Cheers, Tomas
>
>
> -----Original Message-----
> From: Henry Hu [mailto:[email protected]]
> Sent: Monday, July 02, 2012 11:40 AM
> To: [email protected]
> Subject: [Moses-support] Placeholders missed
>
> Hi guys,
>
> I'm attempting to translate English to French. First I replaced some tags 
> with placeholders {70}. Next, decoding. Finally, restoring tags.
> Most placeholders {70} maintained the same in the process of decoding, like 
> this:
>
> English: buy { 70 } and enjoy unlimited Trainings sessions .
> French:  acheter { 70 } et amusez-vous illimitée formations sessions .
>
> However, some placeholders are incomplete, like this( missed { ):
>
> English: acheter { 70 } et amusez-vous illimitée formations sessions .
> French:  illimitée des réunions , chaque avec jusqu' à 70 } les participants
>
> I guess I should use other placeholders. But what placeholders can be 
> options? Thanks for any suggestion.
>
> Best regards,
> Henry
>
>

_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to