Hi everybody,
As some of you might know, I am working on the embeddability of
lttoolbox-java as part of my GSoC project (you can follow my progress
here<http://wiki.apertium.org/wiki/User:Mikel/Embeddable_lttoolbox-java:_Progress>).
The central part of the project consists of having standalone packages for
each language pair that can be run independently as well as easily
integrated in bigger Java projects. This way, the project wouldn't make
much sense if we don't maintain an infrastructure of ready-to-use packages
online for all the language pairs that Apertium supports. Since this is
something that would involve the whole Apertium community, I am writing to
the list to, first, present you what I have been working on so far and,
second, get feedback from you, discuss all this, and adopt the decisions
that we take.
First of all, let's see what those language pair packages consist of. In
order to get a general idea, you can check any of the following links:
- Esperanto ⇆
English<https://apertium.svn.sourceforge.net/svnroot/apertium/branches/gsoc2012/artetxem/packages/en-eo_eo-en.jnlp>
- Basque →
English<https://apertium.svn.sourceforge.net/svnroot/apertium/branches/gsoc2012/artetxem/packages/eu-en.jnlp>
- Basque →
Spanish<https://apertium.svn.sourceforge.net/svnroot/apertium/branches/gsoc2012/artetxem/packages/eu-es.jnlp>
As long as you have Java in your machine, a simple program to translate
between those languages should be launched (and if it is not working for
you, please let me know). And I would like to remark that the only
requirement is Java, the user doesn't need to have any other program
installed in his/her machine, and it works in any operating system,
including Windows. The app is run locally, so it can work offline.
The secret behind those links, that is, the real language pair packages,
are provisionally kept
here<https://apertium.svn.sourceforge.net/svnroot/apertium/branches/gsoc2012/artetxem/packages/jars/>.
The Jars there (one per language pair) are the actual self-contained Java
executables, and not only they work on desktop, but they can also work on
Android and will be adopted by
Arink<http://wiki.apertium.org/wiki/User:Arinkverma>for the Android
app that he is working on. In fact, any other Java program
could easily use them thanks to the API class that lttoolbox-java now
offers.
And now the big question is, how can we maintain all this? I think that we
can distinguish two different steps regarding it:
1) Create the packages (those self-contained Jar files)
2) Maintain the packages online (keep updated versions of all the language
pairs online for anybody to use)
The solution that I have been (and I'm still) working on comes in form of
two bash scripts, each one to carry out one of the tasks (you can find them
here<https://apertium.svn.sourceforge.net/svnroot/apertium/branches/gsoc2012/artetxem/>in
my branch):
1) apertium-pack-j offers an easy way to generate the packages. It requires
to have lttoolbox-java (the one in my branch, not the one in trunk) and
android-sdk installed, and their location must be specified by setting the
LTTOOLBOX_JAVA_PATH and ANDROID_SDK_PATH environment variables. After that,
you can simply run it passing the path to the mode files for which you want
to generate the package as argument, and a ready-to-use package would be
created by the script. For instance, the following command would create a
ready-to-use package for the Esperanto-English language pair named
apertium-eo-en.jar in my machine:
LTTOOLBOX_JAVA_PATH="/usr/local/share/apertium/lttoolbox.jar"
ANDROID_SDK_PATH="/home/mikel/developer/android-sdk-linux"
./apertium-pack-j /usr/local/share/apertium/modes/eo-en.mode
/usr/local/share/apertium/modes/en-eo.mode
As you can see, I simply specify the correct location of lttoolbox-java and
android-sdk in my machine, and pass the location of eo-en.mode and
en-eo.mode (the main modes that correspond to the Esperanto-English
language pair) as argument to apertium-pack-j.
2) apertium-upload-j offers an easy way to maintain the packages created
this way online. For instance, running the following command after the one
exposed in the previous step would automatically update (or upload for the
first time) the package for Esperanto-English:
./apertium-upload-j apertium-eo-en.jar
More precisely, it would correctly rename the package to avoid duplication,
generate a jnlp file (which is used to run the package through Java Web
Start, as in the links above) and commit them to SVN (provisionally to my
branch, Jacob suggested to create a specific directory such as "binaries"
outside trunk for them, but any suggestion is welcome).
As an idea, both scripts could be integrated in the makefiles of each
language pair so that a simple "make upload", for instance, would
automatically create and upload the appropriate packages.
And that's all I have to say. I would now like to listen to you:
suggestions, opinions, questions... are all welcome!
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff