Difference between revisions of "Apertium-tolk"

From Apertium
Jump to navigation Jump to search
Line 20: Line 20:


==Troubleshooting==
==Troubleshooting==

===Restart D-Bus===


The solution to both of the problems below is typically to restart D-Bus. You can do this on Debian and Ubuntu by issuing the following command:
The solution to both of the problems below is typically to restart D-Bus. You can do this on Debian and Ubuntu by issuing the following command:
Line 39: Line 41:
exceptions.ValueError: Unable to guess signature from an empty dict
exceptions.ValueError: Unable to guess signature from an empty dict
Unable to guess signature from an empty dict
Unable to guess signature from an empty dict
</pre>

===Python encodings===

If you get the following error, it means that for some reason UTF-8 is not the default encoding on your system:

<pre>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in
position 1: ordinal not in range(128)
</pre>

You can fix this by making a <code>sitecustomize.py</code> file in either <code>/usr/lib/python2.4/site-packages/</code> or <code>/usr/lib/python2.4/site-packages/</code> (whichever corresponds to your version of Python) with the following contents:

<pre>
# sitecustomize.py
# this file can be anywhere in your Python path,
# but it usually goes in ${pythondir}/lib/site-packages/
import sys;
sys.setdefaultencoding('utf-8');
</pre>
</pre>



Revision as of 19:33, 11 February 2008

apertium-tolk[1] is a program which translates as you type.

What you need

Macedonian to Serbo-Croatian.

Getting apertium-view

Debian

There are debian packages available here. Note: any language pair you want to use will need to be installed from a Debian package as well.

SVN

Check out the apertium-tools/simple-viewer from the subversion repository.

Feature requests

Troubleshooting

Restart D-Bus

The solution to both of the problems below is typically to restart D-Bus. You can do this on Debian and Ubuntu by issuing the following command:

$ sudo /etc/init.d/dbus restart
Method does not exist
org.freedesktop.DBus.Error.UnknownMethod: Method "translate" with signature "a{ss}s" on interface 
"org.apertium.Mode" doesn't exist
Unable to guess signature
  ERROR:dbus.connection:Unable to set arguments ({}, 'A') according to signature None: 
  exceptions.ValueError: Unable to guess signature from an empty dict
  Unable to guess signature from an empty dict

Python encodings

If you get the following error, it means that for some reason UTF-8 is not the default encoding on your system:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in
position 1: ordinal not in range(128)

You can fix this by making a sitecustomize.py file in either /usr/lib/python2.4/site-packages/ or /usr/lib/python2.4/site-packages/ (whichever corresponds to your version of Python) with the following contents:

# sitecustomize.py
# this file can be anywhere in your Python path,
# but it usually goes in ${pythondir}/lib/site-packages/
import sys;
sys.setdefaultencoding('utf-8');

Related software

Apertium-view is a similar, but more complicated GUI tool which shows you every stage of the Apertium pipeline.

Notes

  1. No, this isn't a spelling mistake