BRLTTY can display in-line contracted braille. It does this if:
The following contraction tables are provided:
Remove excessive white-space.
Grade 2 American English
Blank lines are ignored.
Any leading and trailing white-space (any number of blanks and/or tabs) is ignored.
Lines which begin with a number sign (#
) are ignored,
i.e. they're comments.
# This is a comment.
All other lines define table entries.
The general form of a table entry is an opcode followed by its operands. The opcode and its operands are separated from one another by white-space. Each opcode has a specific number of operands, and any text following its last operand is treated as a comment.
opcode operand ... comment
The opcode is a number which tells the translator how to interpret the operands.
Opcode 0
can be used to assign a meaningful name to each needed opcode,
e.g. opcode
for 0
itself.
If, for example, a table begins with:
0 0 opcode
then all the rest of the opcodes it needs can be defined like this:
opcode 1 include
This scheme, i.e. no built-in opcode names, was chosen in order to allow
a table for some language's braille to be written solely in that language itself.
The following operand types are supported:
A sequence of characters other than
white-space (which terminates the string)
and backslashes (\
).
The following special representations are also supported:
\\
backslash
\f
form feed
\n
new line
\o
ooo3-digit octal value
\r
carriage return
\s
blank (space)
\t
horizontal tab
\v
vertical tab
\x
xx2-digit hexadecimal value
An integer. It may be specified in any of the following ways:
A sequence of decimal digits (0
-9
),
with the first digit being nonzero (1
-9
).
A sequence of hexadecimal digits (0
-9
, and either a
-f
or A
-F
),
preceded by either 0x
or 0X
.
A sequence of octal digits (0
-7
),
with the first digit being zero (0
).
A braille symbol.
The braille dots must be specified via their standard numbers
(see section
Braille Dot Numbering Convention),
and, for a multi-cell symbol, the cell specifications
must be separated from one another by a dash (-
).
For example, the contraction for the English word lord
(the letter l
prefixed with dot 5)
would be specified as 5-123
.
A space may be specified via the special dot number 0
.
First, here's a quick summary of all of the contraction table opcodes. For the details, see section Opcodes by Function.
Name opcode.
Include file.
Define capital sign.
Define begin capitals sign.
Define letter sign.
Define number sign.
Translate unconditionally.
Translate unconditionally, remove repetitions.
Translate if word.
Translate if at beginning of word.
Translate if in middle of word.
Translate if at end of word.
Translate if in middle or at end of word.
Translate if in middle of number.
Translate if white-space-bounded word.
Translate unconditionally, join consecutive words of this type.
Translate if word, join to next word.
Translate whole white-space-bounded sequence unconditionally into computer braille.
Prefix with letter sign if word.
Ignore unconditionally.
Translate if at end of number.
Translate if at beginning of number.
Translate if part of leading punctuation.
Translate if part of trailing punctuation.
Translate if word or at beginning of word.
Define end capitals sign.
Now for all of the details. The opcodes here are grouped by function rather than sorted by number. For a numerically sorted list, see section Opcode Summary by Number.
These opcodes make it easier to write contraction tables. They have no direct effect on the character translation.
Assign a name to an opcode. The name must be defined before it's used.
Include the contents of another file. Nesting can be to any depth. Relative paths are anchored at the directory of the including file.
These opcodes define special symbols which must be inserted into the braille text in order to clarify it.
The symbol which capitalizes a single letter.
The symbol which begins a block of capital letters within a word.
The symbol which ends a block of capital letters within a word.
The symbol which marks a letter which isn't part of a word.
The symbol which marks the beginning of a number.
These opcodes define the braille representations for character sequences. Each of them defines an entry within the contraction table. These entries may be defined in any order except, as noted below, when they define alternate representations for the same character sequence.
Each of these opcodes has a characters operand (which must be specified as a string), and a built-in condition governing its eligibility for use. The text is processed strictly from left to right, character by character, with the most eligible entry for each position being used. If there's more than one eligible entry for a given position, then the one with the longest character string is used. If there's more than one eligible entry for the same character string, then the one defined nearest to the beginning of the table is used (this is the only order dependency).
Many of these opcodes have a dots operand
which defines the braille representation for its characters operand.
It may also be specified as an equals sign (=
),
in which case it means one of two things.
If the entry is for a single character,
then it means that the currently selected computer braille representation
(see the
-t command line option
and the
text-table configuration file directive)
for that character is to be used.
If it's for a multi-character sequence,
then the default representation for each character
(see
opcode 6)
within the sequence is to be used.
Some special terms are used within the descriptions of these opcodes.
A maximal sequence of one or more consecutive letters.
Now, finally, here are the opcode descriptions themselves:
Translate the entire white-space-bounded containing character sequence into computer braille (see the -t command line option and the text-table configuration file directive).
Ignore the characters no matter where they appear.
Translate the characters no matter where they appear. If there's only one character, then, in addition, define the default representation for that character.
Translate the characters no matter where they appear. Ignore any consecutive repetitions of the same sequence.
Translate the characters no matter where they appear. Remove white-space between consecutive words matched by this opcode.
Translate the characters if they're a word.
Translate the characters if they're a word. Remove the following white-space if the first character after it is a letter.
Translate the characters if they're a white-space-bounded word.
Prefix the characters with a letter sign (see opcode 4) if they're a word.
Translate the characters if they're either a word or at the beginning of a word.
Translate the characters if they're at the beginning of a word.
Translate the characters if they're in the middle of a word.
Translate the characters if they're either in the middle or at the end of a word.
Translate the characters if they're at the end of a word.
Translate the characters if they're part of punctuation at the beginning of a word.
Translate the characters if they're part of punctuation at the end of a word.
Translate the characters if they're at the beginning of a number.
Translate the characters if they're in the middle of a number.
Translate the characters if they're at the end of a number.