Package org.liblouis
Class LibLouisUTDML
java.lang.Object
org.liblouis.LibLouisUTDML
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
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 final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionboolean
backTranslateFile
(String configFileList, String inputFileName, String outputFileName, String logFileName, String settingsString, int mode) boolean
backTranslateString
(String configFileList, byte[] inbuf, byte[] outbuf, int[] outlen, String logFilename, 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.boolean
charToDots
(String tableList, byte[] inbuf, byte[] outbuf, 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
(String tableList, String logFile, int mode) See if the table in tableList exists and is valid.boolean
dotsToChar
(String tableList, byte[] inbuf, byte[] outbuf, 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
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
static void
initialize
(String dataPath, String writeablePath, String logFile) static void
loadLibrary
(String libraryPath, String librarySuffix) void
loadXMLCatalog
(String filename) Load a XML catalog into LibLouisUTDML.void
logEnd()
void
void
setDataPath
(String path) Path on which liblouis tables and liblouisutdml files can be found.void
setLogFile
(String fileName) void
setLogLevel
(int level) void
setWriteablePath
(String path) Set the path to which temporary files will be written.boolean
translateFile
(String configFileList, String inputFileName, String outputFileName, String logFileName, String settingsString, int mode) The xml document in inputFile is translated into braille and the translation is placed in outputFile.boolean
translateString
(String configFileList, byte[] inbuf, byte[] outbuf, int[] outlen, String logFilename, String settingsString, 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
(String configFileList, String inputFileName, String outputFileName, String logFileName, 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.version()
Return a string giving the versions of both liblouisutdml and liblouis
-
Field Details
-
NoContractions
public static final int NoContractionsDefinitions 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:
-
CompbrlAtCursor
public static final int CompbrlAtCursor- See Also:
-
DotsIO
public static final int DotsIO- See Also:
-
Comp8Dots
public static final int Comp8Dots- See Also:
-
Pass1Only
public static final int Pass1Only- See Also:
-
CompbrlLeftCursor
public static final int CompbrlLeftCursor- See Also:
-
OtherTrans
public static final int OtherTrans- See Also:
-
UcBrl
public static final int UcBrl- See Also:
-
DontInit
public static final int DontInit- See Also:
-
HtmlDoc
public static final int HtmlDoc- See Also:
-
notUC
public static final int notUC- See Also:
-
-
Method Details
-
getInstance
-
initialize
-
loadLibrary
- Throws:
Exception
-
version
Return a string giving the versions of both liblouisutdml and liblouis -
loadXMLCatalog
Load a XML catalog into LibLouisUTDML. -
translateString
public boolean translateString(String configFileList, byte[] inbuf, byte[] outbuf, int[] outlen, String logFilename, String settingsString, 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(String configFileList, byte[] inbuf, byte[] outbuf, int[] outlen, String logFilename, 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(String configFileList, String inputFileName, String outputFileName, String logFileName, 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(String configFileList, String inputFileName, String outputFileName, String logFileName, 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
-
charToDots
Convert the utf8 character string in inbuf to Unicode braille dot patterns and place the result as a utf8 string in outbuf. -
dotsToChar
Convert the utf8 string of dot patterns in inbuf to characters and place the result as a utf8 string in outbuf. -
checkTable
See if the table in tableList exists and is valid. If no errors are found logFile will be empty. -
setDataPath
Path on which liblouis tables and liblouisutdml files can be found. -
file2brl
This method performs the functions of the file2brl program in a more contrrolled environment. -
setWriteablePath
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. -
setLogFile
-
logEnd
public void logEnd() -
registerLogCallback
-
setLogLevel
public void setLogLevel(int level)
-