lvapeab / m4loc

Automatically exported from code.google.com/p/m4loc
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Wrongly aligned sentences using reinsert_wordalignment.pm. #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi guys,

I have added  a unit-test with some simple test-cases to cover some basic 
reinsert_wordalign.pm functionality. Unfortunately it looks like the behavior 
is different than expected.

Could you please try to run the reinsert_wordaling_test.pl unit test script I 
added in cc6ce624047a commit?

I am especially concerned about misalignment in :

source: <x id="1"/> Search <x id="2"/>
expected <x id="1"/> Hledat <x id="2"/>

result:  <x id="1"/> <x id="2"/> Hledat

See text_x1 sub.

---
Note: I would like to add more test-cases to cover maximum of functionality to 
ensure any further changes won't ruin it. What do you thing about it? 

Regards, Tomas

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

Please use labels and text to provide additional information.

Original issue reported on code.google.com by toma...@moravia.com on 27 Nov 2013 at 2:09

GoogleCodeExporter commented 9 years ago
FYI - I have used the trunk version of the reinsert_wordalign.pm module.

Original comment by toma...@moravia.com on 27 Nov 2013 at 2:10

GoogleCodeExporter commented 9 years ago
Hi Tomas,

Thanks a lot for the unit-test and for checking this. You're certainly right 
and it should be ok now. 

I didn't want to resolve this issue while pushing the latest fix because I 
wanted to comment on something:

Please note that the expected result for sub "test_complex" is not accurate. 
Default behaviour for tags is to be associated to the tokens following the tag; 
in this empty tag pair case, tag <g> will be associated to "to", not to "icon", 
thus, reordering won't affect the output. You could move the tag pair before 
"icon" to test it correctly.

Also there is a typo on <g id="1>, should be <g id="1">.

Regards,
Daniel

Original comment by dani.ros...@gmail.com on 3 Dec 2013 at 9:10

GoogleCodeExporter commented 9 years ago
Hi Daniel,

Thank you for explanation about the alignment ordering rules. I have updated 
the testcase according to your advice and it works fine now. Code is checked in 
now.

Moreover, the remaining issues appear fixed as well with your latest update 
from Dec 2. Thus  thanks a lot for the fix!

I think we can close the issue now.

Original comment by toma...@moravia.com on 5 Dec 2013 at 1:48

GoogleCodeExporter commented 9 years ago

Original comment by toma...@moravia.com on 5 Dec 2013 at 1:49