[liblouis-liblouisxml] Have a bug with louis.backTranslate and louis.backTranslateStrings function?

  • From: Hammer Attila <hammera@xxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Tue, 29 May 2012 14:51:24 +0200

Hy,

Mesar wrote we trying extending the harness generation testcases.
I doed a direction field, with have possible values now, future will be possible this is changing: if the direction is f, happening only braille translation, and brl field in the created harness file a testcase get louis.translate function produced proper braille result. This is the default action the test harness file generation if the direction field is not declared before a test text in the source text file. If the direction is b, temporary I generating the original text with braille output with louis.translate function, and doing back translation the temporary stored braille output. Final this type test case the brl field get the louis.backTranslate function returned result, and adding the "direction": "b" field the test case in the json harness file.

Possible i missunderstanding louis.backTranslate function purpose, but ideal case not need resulting this situation the txt and brl fields with equals output?

I generated all already added hungarian words translated and backtranslated outputs with a testing purpose test harness file. I very surprised when I looked the output test harness file. Some backtranslation related testcases the brl field stored value and the txt field stored value is full different.
I sending an attachment some test cases with showing various errors.
In the attached file first will be follow the normal test case, this normal test cases louis.translate function producing absolute right braille result. I verifyed the braille output after I turns off in Orca the contracted braille feature. This situation Orca using hungarian Brltty braille table my system, and the generated normal braille results is full right, my braille display I see the right contracted braille output.
After the normal test case follow the direction: b produced test case.
The last line before the empty line I commenting what character replacement not happening if I using hu1.ctb table with louis.backTranslate function a test case generation in the brl field.

Attila
        {
            "brl": "ad\"s5er}", 
            "txt": "adásszerű"
        }, 
        {
            "brl": "adásszer}", 
            "direction": "b", 
            "txt": "adásszerű"
        }, 
This test case in the brl field louis.backTranslate function not replacing with 
} character with ű character.

        {
            "brl": "$a4agos5erg16", 
            "txt": "Agyagosszergény"
        }, 
        {
            "brl": "Agyagosszerg1ny", 
            "direction": "b", 
            "txt": "Agyagosszergény"
        }, 
This backtranslation test louis.backTranslate not replacing the brl field with 
1 number with é character.

        {
            "brl": "a4ag4}r}iken", 
            "txt": "agyaggyűrűiken"
        }, 
        {
            "brl": "agyaggy}r}iken", 
            "direction": "b", 
            "txt": "agyaggyűrűiken"
        }, 
This test case louis.backTranslate function not replacing in the brl field with 
} character with ű character.

        {
            "brl": "a4on602ott", 
            "txt": "agyonnyúzott"
        }, 
        {
            "brl": "agyonny02ott", 
            "direction": "b", 
            "txt": "agyonnyúzott"
        }, 
This test case louis.backTranslate function not replacing in the brl field with 
2 character with z character, and not replacing with 0 character with ú 
character.

        {
            "brl": "ak\"csqv16", 
            "txt": "akácsövény"
        }, 
        {
            "brl": "akácsqv1ny", 
            "direction": "b", 
            "txt": "akácsövény"
        }, 
This test case in the brl field louis.backTranslate string not replacing q 
character with ö character, and not replacing with 1 character with é character.

        {
            "brl": "al\"s5olg\"ja", 
            "txt": "alásszolgája"
        }, 
        {
            "brl": "alásszolg\"ja", 
            "direction": "b", 
            "txt": "alásszolgája"
        }, 
This test case louis.backTranslate function doesn't replace the second " 
character in the brl field with á character.

        {
            "brl": "a6ag4727", 
            "txt": "anyaggyőző"
        }, 
        {
            "brl": "anyaggyő27", 
            "direction": "b", 
            "txt": "anyaggyőző"
        }, 
This test case in the brl field louis.backTranslate function not replacing the 
second 7 character with ő character.

        {
            "brl": "a6ag4}jt1s", 
            "txt": "anyaggyűjtés"
        }, 
        {
            "brl": "anyaggyűjt1s", 
            "direction": "b", 
            "txt": "anyaggyűjtés"
        }, 
This test case in brl field the louis.backTranslate function not replace with 1 
character with é character.

        {
            "brl": "arc{reg4ullad\"s", 
            "txt": "arcüreggyulladás"
        }, 
        {
            "brl": "arc{reggyullad\"s", 
            "direction": "b", 
            "txt": "arcüreggyulladás"
        }, 
This test case in the brl field louis.backTranslate function not replacing the 
{ character with ü character, and not replacing the " character with á 
character.


Other related posts: