051bd416d3c41002f6d58b9dd71516a27243d178,thumt/launcher/translator.py,,main,#Any#,137

Before Change


                if idx >= 0:
                    output = decoded[:idx].strip()
                else:
                    output = decoded.strip()

                outfile.write("%s\n" % output)

After Change


        with open(params.output, "w") as outfile:
            for output in restored_outputs:
                decoded = []
                for idx in output:
                    if idx == params.mapping["target"][params.eos]:
                        break
                    decoded.append(vocab[idx])

                decoded = " ".join(decoded)
                outfile.write("%s\n" % decoded)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: THUNLP-MT/THUMT
Commit Name: 051bd416d3c41002f6d58b9dd71516a27243d178
Time: 2017-11-11
Author: playinf@stu.xmu.edu.cn
File Name: thumt/launcher/translator.py
Class Name:
Method Name: main


Project Name: pysb/pysb
Commit Name: 31bedbc4d8d62fc42a7c9a20dd51c372cb510447
Time: 2017-05-02
Author: ben.gyori@gmail.com
File Name: pysb/kappa.py
Class Name:
Method Name: _parse_kasim_outfile


Project Name: THUNLP-MT/THUMT
Commit Name: 051bd416d3c41002f6d58b9dd71516a27243d178
Time: 2017-11-11
Author: playinf@stu.xmu.edu.cn
File Name: thumt/launcher/ensemble_translator.py
Class Name:
Method Name: main