Open sdaoden opened 1 month ago
maybe it is interpretation of the response: i print the ast iter from googleTranslate() here, maybe you can get something out of that:
$ trans en=de unfulfilld ITER i=0000 VALUEHERE i<0000> XX<^075$> |||||| ELSE ITER i=0001 VALUE HERE i<0001> XX<^075$> |||||| ELSE ITER i=0002 ITER i=0003 ITER i=0004 VALUE <3> HERE i<0004> XX<^075$> |||||| ELSE ITER i=0005 ITER i=0006 ITER i=0008000 VALUE <84d48e73ebfa38d4d681515b81e0b72a> HERE i<0008000> XX<^075$> |||||| ELSE ITER i=0008001 VALUE HERE i<0008001> XX<^075$> |||||| ELSE ITER i=01 ITER i=02 VALUE HERE i<02> XX<^075$> |||||| ELSE ITER i=03 ITER i=04 ITER i=0500 VALUE HERE i<0500> XX<^075$> |||||| ELSE ITER i=0501 ITER i=050200 VALUE HERE i<050200> XX<^075$> |||||| ELSE ITER i=050201 ITER i=050202 VALUE HERE i<050202> XX<^075$> |||||| ELSE ITER i=050203 VALUE HERE i<050203> XX<^075$> |||||| ELSE ITER i=0502040 VALUE <3> HERE i<0502040> XX<^075$> |||||| ELSE ITER i=050205 ITER i=05020600 VALUE <3> HERE i<05020600> XX<^075$> |||||| ELSE ITER i=050210 VALUE HERE i<050210> XX<^075$> |||||| ELSE 20:21:52 [20/15831] ITER i=050211 ITER i=050212 VALUE HERE i<050212> XX<^075$> |||||| ELSE ITER i=050213 VALUE HERE i<050213> XX<^075$> |||||| ELSE ITER i=0502140 VALUE <8> HERE i<0502140> XX<^075$> |||||| ELSE ITER i=050300 VALUE <0> HERE i<050300> XX<^075$> |||||| ELSE ITER i=050301 VALUE <10> HERE i<050301> XX<^075$> |||||| ELSE ITER i=0504 VALUE HERE i<0504> XX<^075$> |||||| ELSE ITER i=0505 VALUE <0> HERE i<0505> XX<^075$> |||||| ELSE ITER i=0506 VALUE <0> HERE i<0506> XX<^075$> |||||| ELSE ITER i=06 VALUE <1> HERE i<06> XX<^075$> |||||| ELSE ITER i=070 VALUE <unfulfilled> HERE i<070> XX<^075$> |||||| ELSE ITER i=071 VALUE HERE i<071> XX<^075$> |||||| ELSE ITER i=0720 VALUE <1> HERE i<0720> XX<^075$> |||||| ELSE ITER i=0800 VALUE HERE i<0800> XX<^075$> |||||| ELSE ITER i=081 ITER i=0820 VALUE <1> HERE i<0820> XX<^075$> |||||| ELSE ITER i=0830 VALUE HERE i<0830> XX<^075$> |||||| ELSE ITER i=09 ITER i=010 ITER i=011 ITER i=012 ITER i=013 ITER i=014 ITER i=015 ITER i=016 ITER i=017 ITER i=0180 ITER i=0181 VALUE <2> HERE i<0181> XX<^075$> |||||| ELSE ITER i=0 VALUE <0> HERE i<0> XX<^075$> |||||| ELSE unfulfilld unerfüllt Translations of unfulfilld [ English -> Deutsch ] unfulfilld unerfüllt, nicht erfüllt
Silent now, ciao!
(one more: the ELSE is followed by <unfulfilled> here, the textbox swallowed the "unknown tag". Ciao.)
Ok i tell you what, one final addition. I locally change in include/Translators/GoogleTranslate.awk function googleTranslate() from
# 7 - autocorrection if (i ~ "^0" SUBSEP "7" SUBSEP "5$") {
to
# 7 - autocorrection if (i ~ "^0" SUBSEP "7" SUBSEP "5$" || i ~ "^0" SUBSEP "7" SUBSEP "2" SUBSEP "0$") {
and the software does what i want:
$ trans en=de unfulfilld Did you mean: unfulfilled unfulfilld unerfüllt Translations of unfulfilld [ English -> Deutsch ] unfulfilld unerfüllt, nicht erfüllt
but i have no idea what i am doing!
But now really: Ciao!
I will update my port with that, but really, i have no idea
diff --git a/include/Translators/GoogleTranslate.awk b/include/Translators/GoogleTranslate.awk index 8f506e2fb5..456e0e6aa8 100644 --- a/include/Translators/GoogleTranslate.awk +++ b/include/Translators/GoogleTranslate.awk @@ -155,12 +155,12 @@ function googleTranslate(text, sl, tl, hl, altTranslations[group[1]][group[2]] = literal(ast[i]) # 7 - autocorrection - if (i ~ "^0" SUBSEP "7" SUBSEP "5$") { - if (ast[i] == "true") - w("Showing translation for: (use -no-auto to disable autocorrect)") + if (i ~ "^0" SUBSEP "7" SUBSEP "5$" || i ~ "^0" SUBSEP "7" SUBSEP "2" SUBSEP "0$") { + if (ast[i] == "true" || ast[i] == "1") + msg = "Showing translation for (use -no-auto to disable autocorrect): " else - w("Did you mean: " \ - ansi("bold", unparameterize(ast["0" SUBSEP "7" SUBSEP "1"]))) + msg = "Did you mean: " + w(msg ansi("bold", unparameterize(ast["0" SUBSEP "7" SUBSEP "1"]))) } # 8 - identified source languages
Hello. It is good to have your tool around. I yesterday stumbled over a problem once i produced a typo:
I wondered as the above looks as if "unfulfilld" is the correct word, and no "unfulfilled" in sight there. It only is with -dump:
And now comes the fun part: mess up the command line and it works!
With -dump it is sane: