MITRE provides a frame transducer which uses a rule-like set of Python functions to map from frames to frames. It is currently undocumented how to write these transducer functions.
static char *oas[] = {This server also accepts the Python subset (-port, -assert, -validate -verbosity, -maxconns) of the standard server arguments. See the command-line argument parsing library in the Galaxy Communicator documentation for details.
"-default_config_file <str>", "default configuration file", "",
"-transducer_debug", "Enable verbose transducer output",
NULL
};
reinitialize
sets up the transducers from configuration files.
parameter | type | optional | depends on | description/constraints | |
IN: | :config_files | list | yes | a list configuration files to load. | |
:require_frame | integer | yes | If present, indicates that the server should generate an error if the transduction result is not a well-formed frame |
transduce
takes a frame and a sequence of transduction names, performs the transductions
in order, and returns the result. If no transductions are provided, the
default configuration file set on the command line is used. This function
generates an error if the transduction names don't correspond to the names
given to reinitialize.
parameter | type | optional | depends on | description/constraints | |
IN: | :input_frame | frame | the frame to be transduced | ||
:transductions | list | yes | a sequence of transduction files which should correspond to the files provided in the :config_files parameter to reinitialize. The order reflects the order in which the transductions should apply. | ||
:transducer_debug | integer | yes | connection-specific version of -transducer_debug command line argument | ||
OUT: | :output_frame | frame or other | yes | The result of the transduction. In some cases, transductions can result in values other than frames; to enforce frame output, use :require_frame in reinitialize. This represents the normal output of the transducer. :error and :output_frame will not both appear. | |
:error | string | yes | If the transducer encounters an error, it returns it here. :error and :output_frame will not both appear. |
This dispatch function returns a frame.