org.liblouis
Class liblouisutdml

java.lang.Object
  extended by org.liblouis.liblouisutdml

public final class liblouisutdml
extends java.lang.Object


Field Summary
static int Comp8Dots
           
static int CompbrlAtCursor
           
static int CompbrlLeftCursor
           
static int DontInit
           
static int DotsIO
           
static int HtmlDoc
           
static int NoContractions
          Definitions of mode bits The bits for liblouis are included because it is sometimes necessary to pass a liblouis mode to a liblouisutdml function.
static int notUC
           
static int OtherTrans
           
static int Pass1Only
           
static int UcBrl
           
 
Method Summary
 boolean backTranslateFile(java.lang.String configFileList, java.lang.String inputFileName, java.lang.String outputFileName, java.lang.String logFileName, java.lang.String settingsString, int mode)
           
 boolean backTranslateString(java.lang.String configFileList, byte[] inbuf, byte[] outbuf, int[] outlen, java.lang.String logFilename, java.lang.String settingsSrting, int mode)
          the brf characters in inbuf are translated to print characters in outbuf according to the settings in the configuration files and setingsStrring.
 int charSize()
          Return the character size used internally by liblouis and liblouisutdml.
 boolean charToDots(java.lang.String tableList, byte[] inbuf, byte[] outbuf, java.lang.String logFile, int mode)
          Convert the utf8 character string in inbuf to Unicode braille dot patterns and place the result as a utf8 string in outbuf.
 boolean checkTable(java.lang.String tableList, java.lang.String logFile, int mode)
          See if the table in tableList exists and is valid.
 boolean compileString(java.lang.String tableList, java.lang.String newEntry, java.lang.String logFile)
          Add a new entrry to a table.
 boolean dotsToChar(java.lang.String tableList, byte[] inbuf, byte[] outbuf, java.lang.String logFile, int mode)
          Convert the utf8 string of dot patterns in inbuf to characters and place the result as a utf8 string in outbuf.
 boolean file2brl(java.lang.String[] args)
          This method performs the functions of the file2brl program in a more contrrolled environment.
 void free()
          You must call free at the end of your application to free all memory used by liblouisutdml and liblouis.
static liblouisutdml getInstance()
           
 boolean hyphenate(java.lang.String tableList, byte[] inbuf, int inlen, byte[] hyphens, java.lang.String logFileName, int mode)
           
static void initialize(java.lang.String dataPath, java.lang.String writeablePath)
           
static void load(java.lang.String filename)
           
static void loadLibrary()
           
 void logEnd()
           
 void logMessage(java.lang.String message)
           
 boolean louisBackTranslate(java.lang.String tableList, byte[] inbuf, int[] inlen, byte[] outbuf, int[] outlen, byte[] typeform, int[] outputPos, int[] inputPos, int[] cursorPos, java.lang.String logFileName, int mode)
           
 boolean louisBackTranslateString(java.lang.String tableList, byte[] inbuf, int[] inlen, byte[] outbuf, int[] outlen, byte[] typeform, java.lang.String logFileName, int mode)
           
 boolean louisTranslate(java.lang.String tableList, byte[] inbuf, int[] inlen, byte[] outbuf, int[] outlen, byte[] typeform, int[] outputPos, int[] inputPos, int[] cursorPos, java.lang.String logFileName, int mode)
           
 boolean louisTranslateString(java.lang.String tableList, byte[] inbuf, int[] inlen, byte[] outbuf, int[] outlen, byte[] typeform, java.lang.String logFileName, int mode)
           
 void setDataPath(java.lang.String path)
          Path on which liblouis tables and liblouisutdml files can be found.
 void setLogFile(java.lang.String fileName)
           
 void setWriteablePath(java.lang.String path)
          Set the path to which temporary files will be written.
 boolean translateFile(java.lang.String configFileList, java.lang.String inputFileName, java.lang.String outputFileName, java.lang.String logFileName, java.lang.String settingsString, int mode)
          The xml document in inputFile is translated into braille and the translation is placed in outputFile.
 boolean translateString(java.lang.String configFileList, byte[] inbuf, byte[] outbuf, int[] outlen, java.lang.String logFilename, java.lang.String settingsSrting, int mode)
          Make a braille translation of the UTF-8 characters in inbuf according to configuration settings to UTF-8 characters in outbuf.
 boolean translateTextFile(java.lang.String configFileList, java.lang.String inputFileName, java.lang.String outputFileName, java.lang.String logFileName, java.lang.String settingsString, int mode)
          The plain-text file in inFile is translated to braille and the translation placed in outputFile as described for the previous method.
 java.lang.String version()
          Return a string giving the versions of both liblouisutdml and liblouis
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NoContractions

public static final int NoContractions
Definitions of mode bits The bits for liblouis are included because it is sometimes necessary to pass a liblouis mode to a liblouisutdml function. The liblouis bits take up the low-order bits of the mode integer, while the liblouisutdml bits take up the high-order bits, except that the sign bit is skipped.

See Also:
Constant Field Values

CompbrlAtCursor

public static final int CompbrlAtCursor
See Also:
Constant Field Values

DotsIO

public static final int DotsIO
See Also:
Constant Field Values

Comp8Dots

public static final int Comp8Dots
See Also:
Constant Field Values

Pass1Only

public static final int Pass1Only
See Also:
Constant Field Values

CompbrlLeftCursor

public static final int CompbrlLeftCursor
See Also:
Constant Field Values

OtherTrans

public static final int OtherTrans
See Also:
Constant Field Values

UcBrl

public static final int UcBrl
See Also:
Constant Field Values

DontInit

public static final int DontInit
See Also:
Constant Field Values

HtmlDoc

public static final int HtmlDoc
See Also:
Constant Field Values

notUC

public static final int notUC
See Also:
Constant Field Values
Method Detail

getInstance

public static liblouisutdml getInstance()

initialize

public static void initialize(java.lang.String dataPath,
                              java.lang.String writeablePath)

loadLibrary

public static void loadLibrary()
                        throws java.lang.Exception
Throws:
java.lang.Exception

load

public static void load(java.lang.String filename)
                 throws java.lang.Exception
Throws:
java.lang.Exception

version

public java.lang.String version()
Return a string giving the versions of both liblouisutdml and liblouis


translateString

public boolean translateString(java.lang.String configFileList,
                               byte[] inbuf,
                               byte[] outbuf,
                               int[] outlen,
                               java.lang.String logFilename,
                               java.lang.String settingsSrting,
                               int mode)
Make a braille translation of the UTF-8 characters in inbuf according to configuration settings to UTF-8 characters in outbuf. The latter will be in Unicode braille. The return value is true if the translation is successful and false if not. Any errors are recorded in logFile. If this is null, they are printed on stderr. There may be errors even if the return value is true. If there are none, the log file will be empty. settingsstring may be used to pass in configuration settings.


backTranslateString

public boolean backTranslateString(java.lang.String configFileList,
                                   byte[] inbuf,
                                   byte[] outbuf,
                                   int[] outlen,
                                   java.lang.String logFilename,
                                   java.lang.String settingsSrting,
                                   int mode)
the brf characters in inbuf are translated to print characters in outbuf according to the settings in the configuration files and setingsStrring. The translation will be in UTF-8.


translateFile

public boolean translateFile(java.lang.String configFileList,
                             java.lang.String inputFileName,
                             java.lang.String outputFileName,
                             java.lang.String logFileName,
                             java.lang.String settingsString,
                             int mode)
The xml document in inputFile is translated into braille and the translation is placed in outputFile. The return value and log file are as described above.


translateTextFile

public boolean translateTextFile(java.lang.String configFileList,
                                 java.lang.String inputFileName,
                                 java.lang.String outputFileName,
                                 java.lang.String logFileName,
                                 java.lang.String settingsString,
                                 int mode)
The plain-text file in inFile is translated to braille and the translation placed in outputFile as described for the previous method. If the text contains blank lines they are treated as paragraph breaks.


backTranslateFile

public boolean backTranslateFile(java.lang.String configFileList,
                                 java.lang.String inputFileName,
                                 java.lang.String outputFileName,
                                 java.lang.String logFileName,
                                 java.lang.String settingsString,
                                 int mode)

charToDots

public boolean charToDots(java.lang.String tableList,
                          byte[] inbuf,
                          byte[] outbuf,
                          java.lang.String logFile,
                          int mode)
Convert the utf8 character string in inbuf to Unicode braille dot patterns and place the result as a utf8 string in outbuf.


dotsToChar

public boolean dotsToChar(java.lang.String tableList,
                          byte[] inbuf,
                          byte[] outbuf,
                          java.lang.String logFile,
                          int mode)
Convert the utf8 string of dot patterns in inbuf to characters and place the result as a utf8 string in outbuf.


checkTable

public boolean checkTable(java.lang.String tableList,
                          java.lang.String logFile,
                          int mode)
See if the table in tableList exists and is valid. If no errors are found logFile will be empty.


compileString

public boolean compileString(java.lang.String tableList,
                             java.lang.String newEntry,
                             java.lang.String logFile)
Add a new entrry to a table.


setDataPath

public void setDataPath(java.lang.String path)
Path on which liblouis tables and liblouisutdml files can be found.


charSize

public int charSize()
Return the character size used internally by liblouis and liblouisutdml.


file2brl

public boolean file2brl(java.lang.String[] args)
This method performs the functions of the file2brl program in a more contrrolled environment.


setWriteablePath

public void setWriteablePath(java.lang.String path)
Set the path to which temporary files will be written.


free

public void free()
You must call free at the end of your application to free all memory used by liblouisutdml and liblouis. Do NOT call it after every call to a liblouisutdml method. This will result in great inefficiency. The memory used by liblouisutdml for each document is freed wen the method completes, but some memory holding configuration settings is held. The memory used by liblouis is freed only when the free method is called.


louisTranslateString

public boolean louisTranslateString(java.lang.String tableList,
                                    byte[] inbuf,
                                    int[] inlen,
                                    byte[] outbuf,
                                    int[] outlen,
                                    byte[] typeform,
                                    java.lang.String logFileName,
                                    int mode)

louisTranslate

public boolean louisTranslate(java.lang.String tableList,
                              byte[] inbuf,
                              int[] inlen,
                              byte[] outbuf,
                              int[] outlen,
                              byte[] typeform,
                              int[] outputPos,
                              int[] inputPos,
                              int[] cursorPos,
                              java.lang.String logFileName,
                              int mode)

hyphenate

public boolean hyphenate(java.lang.String tableList,
                         byte[] inbuf,
                         int inlen,
                         byte[] hyphens,
                         java.lang.String logFileName,
                         int mode)

louisBackTranslateString

public boolean louisBackTranslateString(java.lang.String tableList,
                                        byte[] inbuf,
                                        int[] inlen,
                                        byte[] outbuf,
                                        int[] outlen,
                                        byte[] typeform,
                                        java.lang.String logFileName,
                                        int mode)

louisBackTranslate

public boolean louisBackTranslate(java.lang.String tableList,
                                  byte[] inbuf,
                                  int[] inlen,
                                  byte[] outbuf,
                                  int[] outlen,
                                  byte[] typeform,
                                  int[] outputPos,
                                  int[] inputPos,
                                  int[] cursorPos,
                                  java.lang.String logFileName,
                                  int mode)

setLogFile

public void setLogFile(java.lang.String fileName)

logMessage

public void logMessage(java.lang.String message)

logEnd

public void logEnd()