help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pointers on translation library


From: Eric Abrahamsen
Subject: pointers on translation library
Date: Sat, 16 Apr 2011 22:45:47 +0800
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/23.2 (gnu/linux)

I recently discovered the cjklib[1] library, for translations and other
various operations on Chinese/Japanese/Korean characters. It's a Python
library with a Sqlite backend.

I do my translations in Emacs, and would love to use this to replace
both my paper dictionary, and other electronic dictionaries. I've
already used it to make a command for looking up words (an Emacs
function that calls an external python script and 'message's the
results), but it's fairly slow, because the Python libraries and
dictionaries have to be loaded and then sqlite database bindings created
and all the rest for every call. So I'm considering alternatives:

1. Calling from emacs to the sqlite databases directly
2. Starting a python subprocess that will load the dictionaries and
   databases and persist them, and then provide functions that can be
   called to answer specific queries. When I'm done translating, I kill
   the subprocess.

I'm leaning towards number 2, mostly because the cjklib authors have
provided some very handy lookup functions/classes, and I'd like to make
use of them.

The subprocess functions in the Emacs codebase (like 'run-python') seem
to be rooted in the C base, and it's hard to get examples. If anyone has
any pointers for running a python subprocess, loading a library, calling
functions (I don't need to see the python buffer, I just want to call
functions and be messaged the results), then killing the process, that
would be most welcome...

Thanks,
Eric

Footnotes: 
[1]  http://cjklib.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]