|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The interface defining Java text/Braille translation classes that implement the UMIST, Manchester, UK translation algorithm.
Classes implementing Language
should use the same global
constants for the language information.
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
The filename extension, including the dot, that indicates the Language definition tables in their editable human-readable plain text form for this language. |
static char |
FILE_EXTENSION_DELIMITER
Used to delimit the filename extension from the main filename body. |
static java.lang.String |
FILENAME_EXTENSION
The filename extension that indicates the Language data file for this Language, imported when the Language is instantiated. |
static char |
LEFT_FOCUS_DELIMITER
The ASCII/Unicode character used to denote the end of the left context and the start of the focus in a translation rule. |
static char |
RIGHT_FOCUS_DELIMITER
The ASCII/Unicode character used to denote the end of the focus and the start of the right context in a translation rule. |
static int |
RULE_BUFFER
The maximum size of a single translation rule in characters. |
static char |
RULE_CONTENT_DELIMITER
The value used to denote the end of the output in a translation rule - only for legacy 256-character-set languages. |
static char |
RULE_OUTPUT_DELIMITER
The ASCII/Unicode character used to denote the end of the right context and the start of the rule output in a translation rule. |
static int |
SPACE_FLAG
Defines the value of the bit that must be set to indicate a whitespace character. |
static char |
TABLE_DELIMITER
Character denoting the end of the list of translation rules in a language rules table in a 256-character Language system. |
static int |
WILDCARD_FLAG
Defines the value of the bit that must be set to indicate a wildcard character in any language. |
static int |
WILDCARD_NONE
Information for a wildcard definition - wildcards of type WILDCARD_NONE must must match zero or more of its type in the input text. |
static int |
WILDCARD_ONE
Information for a wildcard definition - wildcards of type WILDCARD_NONE must must match exactly one its type in the input text. |
static int |
WILDCARD_SEVERAL
Information for a wildcard definition - wildcards of type WILDCARD_NONE must may match one or more of its type in the input text. |
Method Summary | |
int |
getPermittedStates()
Returns the states permitted in this language. |
int |
getState()
Returns the current state of the virtual machine. |
boolean |
setState(int state)
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[] toConvert)
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. |
Field Detail |
public static final int WILDCARD_FLAG
public static final int SPACE_FLAG
public static final int WILDCARD_NONE
public static final int WILDCARD_ONE
public static final int WILDCARD_SEVERAL
public static final int RULE_BUFFER
public static final char LEFT_FOCUS_DELIMITER
public static final char RIGHT_FOCUS_DELIMITER
public static final char RULE_OUTPUT_DELIMITER
public static final char RULE_CONTENT_DELIMITER
public static final char TABLE_DELIMITER
public static final java.lang.String FILENAME_EXTENSION
public static final char FILE_EXTENSION_DELIMITER
public static final java.lang.String DATAFILE_EXTENSION
Method Detail |
public boolean setState(int state)
state
- 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.public int getPermittedStates()
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 int getState()
int
state of the virtual machine, in the
range 1 to numberStates
.public java.lang.String translate(java.lang.String toConvert)
toConvert
- String
holding characters to translate.
String
holding the output text, characters now translated.public int[] translate(int[] toConvert)
toConvert
- int[]
holding characters to translate.
int[]
holding the output text, characters now translated.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |