viernes, 30 de septiembre de 2011

Traducir desde la Consola

Instalamos el paquete:
# apt-get install apertium-en-es


Editamos un archivo y ponemos dentro algo en ingles:
# vim ingles-input.txt
My name is walrus Peter.


Traducimos de ingles a espanol:
# apertium en-es ingles-input.txt > espanol-output.txt


Vemos el texto traducido:
# cat espanol-output.txt
Mi nombre es Peter.


Si queremos traducir de ingles a espanol, simplemente invertimos el en-es por es-en.

Si queremos por ejemplo traducir el man del bash, realizamos lo siguiente:
# man bash > bash-en-ingles.txt
# apertium en-es ingles-input.txt > espanol-output.txt

No hay comentarios: