translate-shell icon indicating copy to clipboard operation
translate-shell copied to clipboard

Apertium doesn't work

Open Hund opened this issue 5 years ago • 3 comments

I'm using version 0.9.6.11 and Apertium doesn't work for me.

$ trans -e apertium :sv dog
dog

[ English -> Svenska ]
$ trans -e apertium :es dog
dog

[ English -> Español ]
$ trans -e apertium hund
hund

[ English -> English ]

Google works just fine though, but it would be nice with an ethical alternative.

Hund avatar Nov 16 '20 11:11 Hund

Also, it seems to conflate nn and nb into one (and doesn't know that nob is nb and nno is nn), so Apertium's most used language pair is not usable:

$ trans -e apertium nb:nn 'Vi liker ikke å sykle'
Vi liker ikke å sykle



[ Norsk -> Norsk ]
$ trans -e apertium nob:nno 'Vi liker ikke å sykle'
[WARNING] Unknown source language code: nob
[WARNING] Unknown target language code: nno
Vi liker ikke å sykle



[  ->  ]

unhammer avatar Nov 19 '20 11:11 unhammer

https://github.com/soimort/translate-shell/blob/5ad78dcc66947d0edd86b8cb1a9fac8b02e16270/include/Translators/Apertium.awk#L9..11 seems out of date, use https/443:

$ echo "Vi liker ikke å sykle" | curl -s --data-urlencode q@- "https://apertium.org/apy/translate?markUnknown=yes&langpair=nob|nno" | jq .responseData.translatedText
"Vi liker ikkje å sykla"

unhammer avatar Nov 19 '20 11:11 unhammer

c6f5c65 partially fixes the main issue. Most language pairs (as supported by Apertium) should work now:

$ trans -brief -e apertium da:sv 'den brune hund'
den bruna hunden

For Norwegian, trans cannot distinguish bokmål and nynorsk (in fact, it treats nb and nn as exactly the same), which is another issue yet to be fixed.

soimort avatar Oct 29 '22 21:10 soimort