2012/3/20 Jayamal De Vas Gunawardhana <[email protected]>

> Hi all,
>
> Can anyone give me a hint to work on the coding challenge. I'm using
> eclipse for development. I downloaded and build the Lttoolbox-java but I'm
> stuck there. Yet I have no idea about how to combine language pair with it.
>

Your'e right!
Its not written at all on http://wiki.apertium.org/wiki/Lttoolbox-java how
to use the Java port on a language pair.

Basically there's an 'apertium-j' command that can execute in exactly the
same way as the 'apertium' command.

So, after installation of lttoolbox-j you can write for example:

$ echo "Saluton, mi estas Jacob" | apertium-j -d
~/esperanto/apertium/apertium-eo-en/  eo-en
Hello, I am Jacob

where ~/esperanto/apertium/apertium-eo-en/ is the path to Esperanto-English
language pair.




>
> Thanx in advance.
>

Thanks for asking. Even more thanks if you fix the wiki :-)




== More info for those that wants to look into the code ==

You can have a look into how it works by looking at the shell script:

$ which apertium-j
/usr/local/bin/apertium-j



$ cat /usr/local/bin/apertium-j
#!/bin/sh

# NOTE: This script simply finds the JAR file and invokes it, first
argumant being the name of this shell script.
# Therefore all programs are served by the same script

# Heap space memory for JVM
defaultMinMem=64
defaultMaxMem=800
library=`dirname $0`/../share/apertium/lttoolbox.jar

if [ ! -e $library ]
then
    library=`dirname $0`/dist/lttoolbox.jar
    if [ ! -e $library ]
    then
        library=`dirname $0`/lttoolbox.jar
        if [ ! -e $library ]
        then
            if [ -e dist/lttoolbox.jar ]
            then
                library=dist/lttoolbox.jar
            elif [ -e lttoolbox.jar ]
            then
                library=lttoolbox.jar
            fi
        fi
    fi
fi

# echo java -Dlttoolbox.jar=${library} -Dfile.encoding=UTF-8
-Xms${defaultMinMem}m -Xmx${defaultMaxMem}m -jar ${library} $0 $*
# use -client to avoid server optimizations which take much more resources
and optimize in the wrong places anyway
java -Dlttoolbox.jar=${library} -client -Dfile.encoding=UTF-8
-Xms${defaultMinMem}m -Xmx${defaultMaxMem}m -jar ${library} $0 $*


So basically the above is invoking

java -jar lttoolbox.jar apertium-j -d ~/esperanto/apertium/apertium-eo-en/
eo-en



Jacob

-- 
Jacob Nordfalk <https://plus.google.com/114820443085046080944>
http://javabog.dk
Android-udvikler og underviser på
IHK<http://cv.ihk.dk/diplomuddannelser/itd/vf/MAU>og
Lund&Bendsen <https://www.lundogbendsen.dk/undervisning/beskrivelse/LB1809/>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to