Rainbow - Command Line
When starting Rainbow has different behaviors depending on the arguments it has when starting:
- If Rainbow is started with just one argument: it starts in normal mode and takes the argument as a project file to be loaded.
- If Rainbow is started with more than one argument: it starts in command-line mode and interprets the arguments as described in the table below.
When running in batch mode, the log is saved into a file named
rainbowBatchLog.txt in the home directory of the user.
Note that you can also use Tikal to execute various function from a command line.
The arguments of the command-line can be the following:
||Sets the input file, and optionally sets the filter configuration to assign to it. You can specify an absolute or a local filename. The input file root is reset to the folder of the given input file. If a project was loaded, all input files in that projects are removed and the input file root reset.
If you specify several input files (and their filter configurations) the first one will be assigned to the Input List 1, the second to the Input List 2, etc.
If the filter configuration is not specified in the command line, the default filter (if one can be found) is used.
Input files must be specified prior to an output location being specified (via
||Loads an existing project file |
||Executes the utility or the predefined pipeline with the ID |
||Loads and execute the specified pipeline stored in |
||Sets the default source encoding to |
||Sets the default target encoding to |
||Sets the source language using |
||Sets the target language using |
||Sets the options file to use for the utility to execute. Use the |
||Sets the path to the log file. If not specified |
||No prompt for utility's options.|
||Sets the output file. If this option is not used and an input file is specified, the output file path and name is build based on the output options of the project (loaded or default). If this option is specified before an input file is provided, an error will be reported in the log.|
||Sets the parameters directory (the location where the filter parameters files are stored). You can use |
||Sets the input root directory for the first input list. You can use |
||Sets the root directory. You can use |
||Opens this help page.|
Here are some example of command lines in Windows. They assume Rainbow is installed in
C:\>java -jar \rnb\lib\rainbow.jar -x TextRewriting -sl EN -tl FR myInput.xlf -o myOutput.xlf
The command-line above executes the Text Rewriting predefined pipeline with the source language set to EN and the target language set to FR. The input document is the XLIFF file
myInput.xlf, and the modified file is saved as
C:\>java -jar \rnb\lib\rainbow.jar -x TranslationComparison -sl EN -tl FR -pd . myHumanTrans.xlf myMachineTrans.txt -fc okf_regex@myText
The command-line above executes the Translation Comparison predefined pipeline with the source language set to EN and the target language set to FR. The current folder (
.) is specified as the parameters directory. The input file
myHumanTrans.xlf is the input document for the Input List 1, and the default XLIFF filter configuration assigned to it. The input file
myMachineTrans.txt is the input document for the Input List 2, and the custom filter parameters
okf_regex@myText.fprm is associated with it. No utility options are specified, so the use will be prompted to set the options.
C:\>java -jar \rnb\lib\rainbow.jar -h
The command-line above opens this help page.
On macOS, go to /Applications, ~/Applications, or wherever you installed Okapi, and replace the "java -jar \rnb\lib\rainbow.jar" part above with "Rainbow.app/Contents/MacOS/rainbow.sh". For example:
Applications $ Rainbow.app/Contents/MacOS/rainbow.sh -h