revised unit testssrc/textprocessing/src/test/java/eu/modernmt/processing/xml/XMLTagProjectorSpacingTest.java
@@ -61,7 +61,6 @@ public class PostprocessorTest {
LanguageDirection reverseLanguage = new LanguageDirection(language.target, language.source);
Sentence expectedSentence = preprocessor.process(reverseLanguage, expected);
- assertArrayEquals(expectedSentence.getTags(), translation.getTags());
}
@@ -161,5 +160,16 @@ public class PostprocessorTest {
test(sourceStr, targetStr, alignStr, expectedOutput, expectedOutputNoTag, new LanguageDirection(Language.FRENCH, Language.ENGLISH));
}
+ @Test
+ public void testEmbeddedTokensWithNonMonotoneAlignment() throws Throwable {
+
+ String sourceStr = "example with <a>nested <b>tag</b></a>";
+ String targetStr = "esempio con tag nidificato";
+ String alignStr = "0-0 1-1 2-3 3-2";
+
+ String expectedOutput = "esempio con <a> <b>tag</b> nidificato</a>";
+ String expectedOutputNoTag = "esempio con tag nidificato";
+ test(sourceStr, targetStr, alignStr, expectedOutput, expectedOutputNoTag);
+ }
}
