|
|||||
Aided translation types | |||||
Prerequisite Concepts | Related Syntax |
If you are building filters or other types of batch translation programs, you can use OmniMark's aided translation types to simplify your code.
The submit
, do sgml-parse
, and do xml-parse
actions allow you to direct input to the pattern processor and the markup processor within a normal OmniMark program. The using output as
and output-to
actions let you control where your output will go. Aided translation types simplify matters by automatically sending input from a source specified on the OmniMark command line directly to a particular processor, and output directly to the appropriate destination for the type of translation. Each translation type hooks up the text and the markup processors in a different way.
The cross-translate
translation type is used for conventional pattern processing chores. It sends input directly to the pattern processor; output goes directly to #main-output
.
The up-translate
translation type is used to add markup to data. It sends input directly to the pattern processor and sends output to #main-output
, just as in a cross-translate. However, it also sends a copy of the output to the markup processor. The markup processor does not produce any output, but it will raise errors if the markup it receives is incorrect. This checks the validity of the markup that is produced.
The down-translate
translation type is used to convert marked-up data into another form (which may or may not contain markup). A down-translate
sends input directly to the markup processor; output goes directly to #main-output
.
The context-translate
translation type is used to convert data from one format to another using a particular markup as an intermediate format. A context-translate
sends input directly to the pattern processor and sends the output of the pattern processor to the markup processor. Output from the markup processor goes to #main-output
.
You cannot use the process
rule in a program that uses an aided translation type. (Though you can use process-start
and process-end
rules.)
There are also some rule types designed specially for use in aided translation programs:
Aided translation types take their main input from the command line or files named on the command line. However, you can still use submit
, do sgml-parse
, and do xml-parse
to submit data to the text or markup processors. Note that you cannot use do sgml-parse
or do xml-parse
in a cross-translation.
Prerequisite Concepts About OmniMark |
Related Syntax context-translate cross-translate down-translate up-translate |
---- |