Liblouis User's and Programmer's Manual
2.13 The correct Opcode ¶
correct test action
Because some input (such as that from an OCR program) may contain systematic errors, it is sometimes advantageous to use a pre-translation pass to remove them. The errors and their corrections are specified by the
correct
opcode. If there are nocorrect
opcodes in a table, the pre-translation pass is not used. If any back-translation corrections have been specified then they are applied in a post-translation (i.e. the very last) pass.Note that like the
context
opcode (seecontext
) and multi-pass opcodes, thecorrect
opcode must be preceded bynoback
opcode (seenoback
) ornofor
opcode (seenofor
).The format of the
correct
opcode is very similar to that of thecontext
opcode (seecontext
). The only difference is that in the action part strings may be used and dot patterns may not be used. Some examples ofcorrect
opcode entries are:noback correct "\\" ? Eliminate backslashes noback correct "cornf" "comf" fix a common "scano" noback correct "cornm" "comm" noback correct "cornp" "comp" noback correct "*" ? Get rid of stray asterisks noback correct "|" ? ditto for vertical bars noback correct "\s?" "?" drop space before question mark