简体   繁体   中英

APERTIUM PYTHON: Translation from Spanish to Catalan

I am a complete newbie trying to use Apertium for translating Spanish short strings to Catalan, however I get the following warning:

lt-proc: invalid option -- 'x'

I have read that that's common in the Python module and is not deeply worrying, however, the problem comes with the following minimal example:

import apertium
# apertium.installer.install_module("spa-cat")
t = apertium.Translator('spa', 'cat')
print(t.translate('Coche rojo.',mark_unknown=False))

That prints:

^Cotxe/*Cotxe$ ^vermell/*vermell$.

Altough it seems to be translating ok ("Coche rojo" = "Cotxe vermell") I can't find why all those symbols are appearing and why the words are repeated. This doesn't happen to me when I use other translation pairs such as English-Spanish.

I finally solved it doing the following:

sudo apt-get purge -y lttoolbox

And then re-installing all the languages via:

import apertium
apertium.installer.install_module("spa")
apertium.installer.install_module("cat")
apertium.installer.install_module("spa-cat")

With this, both the warning and the inconvenient symbols went away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM