[liblouis-liblouisxml] Java bindings for liblouis publically available

  • From: Michael Whapples <mwhapples@xxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Wed, 03 Jun 2009 17:04:06 +0100

Hello,
I am please to say that I have now uploaded my start on the java bindings to a publically accessible mercurial server. Please be aware that these aren't yet at a point where I would say they are ready for a release, but the work may be of interest to those who do use java. You can find details of the repository at http://bitbucket.org/mwhapples/jlouis.

To use these bindings you will need:

* Java, the JDK if you are going to compile the source (which you will have to unless someone else has done it for you). I am using java 6 on my machine, but I don't believe there is any code which won't run on java 5. * JNA (java native access) http://jna.dev.java.net version 3.0.9 is the one I used. * Liblouis, I have tested it on 1.6.0 and 1.6.1 but other versions should work, just be aware of very old versions where the API of liblouis may have been different.

Here is some details of the state of these bindings:

* The JNA code seems to be complete for calling functions in liblouis (at least on linux, may be those familiar with other platforms could try them and see what happens and help fix any problems). One function call not covered is lou_readCharFromFile but it doesn't seem to be of any current great importance. * There is a test program to test lou_version, lou_translateString and lou_backTranslateString functions, its named TestBrl.java. Use this by giving the table name as first arguement and second argument as the text to translate. It will print to screen the version of liblouis, the Braille translation of the text in the second arguement and the back translation of the Braille it produces. NOTE: This program isn't design to check things, it purely is a quick knocked together bit of code to confirm whether the JNA code was working. * I intend to make a java friendly API, this will live in the package org.liblouis. I have made a start on it but it is very incomplete. There is a test program Test.java for this which takes the same arguements as TestBrl.java but currently it only performs forward translation due to the incompleteness of org.liblouis API. * Should you get any output which doesn't seem to make sense, then it may be that liblouis is compiled for a different unicode size (as it can be compiled for either 16-bit or 32-bit unicode). You can alter the encoding used by TestBrl.java and the org.liblouis API by changing the jlouis.encoding variable in jlouis.properties.

I look forward to hearing feedback.

Michael Whapples
For a description of the software and to download it go to
http://www.jjb-software.com

Other related posts:

  • » [liblouis-liblouisxml] Java bindings for liblouis publically available - Michael Whapples