|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.umist.co.brailletrans.LanguageInteger
Language
class based on the C implementation BrailleTrans by Paul
Blenkhorn, UMIST, Manchester, UK. This runs the fastest of all the
Language
implementations developed by Alasdair King.
Copyright 1999, 2004 Alasdair King. This program is free software under the terms of the GNU General Public License.
Field Summary | |
static java.lang.String |
DATAFILE_EXTENSION
Indicates the text-only human-editable language rules tables format on disk. |
static java.lang.String |
FILENAME_EXTENSION
Indicates language rules tables (data files) on disk, suitable for loading into the LanguageInteger class and performing translation. |
Fields inherited from interface uk.ac.umist.co.brailletrans.Language |
FILE_EXTENSION_DELIMITER, LEFT_FOCUS_DELIMITER, RIGHT_FOCUS_DELIMITER, RULE_BUFFER, RULE_CONTENT_DELIMITER, RULE_OUTPUT_DELIMITER, SPACE_FLAG, TABLE_DELIMITER, WILDCARD_FLAG, WILDCARD_NONE, WILDCARD_ONE, WILDCARD_SEVERAL |
Constructor Summary | |
LanguageInteger(java.lang.String filename)
Loads a LanguageInteger object from disk. |
Method Summary | |
int |
getPermittedStates()
Returns the states permitted in this language. |
int |
getState()
Returns the current state of the virtual machine. |
boolean |
setState(int newState)
Sets the state of the finite state machine performing the translation, and therefore controls the type of translation performed, depending on the translation language selected. |
int[] |
translate(int[] input_txt)
Performs translation from text to Braille or from Braille to text, depending on language and state. |
java.lang.String |
translate(java.lang.String toConvert)
Performs translation from text to Braille or from Braille to text, depending on language and state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String FILENAME_EXTENSION
LanguageInteger
class and performing translation.
public static final java.lang.String DATAFILE_EXTENSION
MakeLegacy
Constructor Detail |
public LanguageInteger(java.lang.String filename) throws java.io.IOException, java.io.FileNotFoundException, LanguageLegacyDatafileFormatException
filename
- Full path and name of language rules table as file to load,
according to local filesystem. Do not append the filename extension, for
example ".DAT", just use the full path except this, for example
"C:\trans\english" for the english.dat language rules table.Method Detail |
public int[] translate(int[] input_txt)
Language
translate
in interface Language
input_txt
- int[]
holding characters to translate.
int[]
holding the output text, characters now translated.public java.lang.String translate(java.lang.String toConvert)
Language
translate
in interface Language
toConvert
- String
holding characters to translate.
String
holding the output text, characters now translated.public int getState()
Language
getState
in interface Language
int
state of the virtual machine, in the
range 1 to numberStates
.public int getPermittedStates()
Language
getPermittedStates
in interface Language
int
, the number of states defined
for the language and hence the number of permitted
states. The state can be any integer from 1 to
numberStates
.public boolean setState(int newState)
Language
setState
in interface Language
newState
- An int
containing the new state for the machine to take.
boolean
indicating whether setting the state was
successful. It will fail if the new state requested is outside
the limits of states for the language being used.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |