Liblouis User's and Programmer's Manual
2 How to Write Translation Tables ¶
For many languages there is already a translation table, so before creating a new table start by looking at existing tables to modify them as needed.
Typically, a braille translation table consists of several parts. First are header and includes, in which you write what the table is for, license information and include tables you need for your table.
Following this, you’ll write various translation rules and lastly you write special rules to handle certain situations.
A translation rule is composed of at least three parts: the opcode (translation command), character(s) and braille dots. An opcode is a command you give to a machine or a program to perform something on your behalf. In liblouis, an opcode tells it which rule to use when translating characters into braille. An operand can be thought of as parameters for the translation rule and is composed of two parts: the character or word to be translated and the braille dots.
For example, suppose you want to read the word ‘world’ using braille dots ‘456’, followed by the letter ‘W’ all the time. Then you’d write:
always world 456-2456
The word always
is an opcode which tells liblouis to always
honor this translation, that is to say when the word ‘world’ (an
operand) is encountered, always show braille dots ‘456’ followed
by the letter ‘w’ (‘2456’).
When you write any braille table for any language, we’d recommend working from some sort of official standard, and have a device or a program in which you can test your work.
- Overview
- Hyphenation Tables
- Character-Definition Opcodes
- Braille Indicator Opcodes
- Opcodes for Standing Alone Sequences
- Emphasis Opcodes
- Special Symbol Opcodes
- Special Processing Opcodes
- Translation Opcodes
- Character-Class Opcodes
- Swap Opcodes
- The Context and Multipass Opcodes
- The correct Opcode
- The match Opcode
- Miscellaneous Opcodes