Problems with Rainbow from the command line

54 views
Skip to first unread message

Víctor Parra García

unread,
Jan 27, 2025, 6:26:36 AMJan 27
to okapi-users
Hi all!
I'm trying to automate the ID-Based Alignment through a batch script.
If I do it without using any custom filter configuration it works like a charm:

call %okapiPath%\rainbow.exe -pln W:\Tools\ENGTools\Pipelines\id_based_alignment.pln -sl %SLC% -tl %TLC% %original_path%\src\*.json %original_path%\tgt\*.json -np -log %original_path%\log.txt

The issue arises when I try to indicate the command to use a custom filter configuration:

call %okapiPath%\rainbow.exe -pln W:\Tools\ENGTools\Pipelines\id_based_alignment.pln -sl %SLC% -tl %TLC% -pd %original_path% %original_path%\src\*.json -fc okf_...@json.fprm %original_path%\tgt\*.json -fc okf_...@json.fprm -np -log %original_path%\log.txt

This is producing an empty TMX file and the log shows the following:

-------------------------------------------------------------------------------
Rainbow - Command-Line Mode
Version: 1.47.0
-------------------------------------------------------------------------------
net.sf.okapi.common.exceptions.OkapiException: Unsupported filter type 'okf_...@json.fprm'.
at net.sf.okapi.steps.common.RawDocumentToFilterEventsStep.handleEvent(RawDocumentToFilterEventsStep.java:126)
at net.sf.okapi.common.pipeline.Pipeline.execute(Pipeline.java:117)
at net.sf.okapi.common.pipeline.Pipeline.process(Pipeline.java:227)
at net.sf.okapi.common.pipeline.Pipeline.process(Pipeline.java:199)
at net.sf.okapi.common.pipelinedriver.PipelineDriver.processBatch(PipelineDriver.java:182)
at net.sf.okapi.applications.rainbow.pipeline.PipelineWrapper.execute(PipelineWrapper.java:484)
at net.sf.okapi.applications.rainbow.pipeline.PipelineWrapper.execute(PipelineWrapper.java:423)
at net.sf.okapi.applications.rainbow.CommandLine.launchPipeline(CommandLine.java:376)
at net.sf.okapi.applications.rainbow.CommandLine.execute(CommandLine.java:102)
at net.sf.okapi.applications.rainbow.Main.main(Main.java:49)

I've tried several things, like testing the filter in an isolated way (it works) and using Rainbow from the Gui (which also works). I'm starting to thing the issue is the syntax on my command but at this point I'm completely stuck, anyone can help?

Chase Tingley

unread,
Jan 27, 2025, 2:20:42 PMJan 27
to Víctor Parra García, okapi-users
Hi Victor,

It looks like the -fc option to Rainbow doesn't handle custom filters.  I was able to reproduce this with a simple pipeline.  I'll file an issue.

--
You received this message because you are subscribed to the Google Groups "okapi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to okapi-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/okapi-users/2a357ab5-c2fc-4e1c-b021-2af6e361adecn%40googlegroups.com.

Chase Tingley

unread,
Jan 27, 2025, 2:23:07 PMJan 27
to Víctor Parra García, okapi-users

Víctor Parra García

unread,
Jan 29, 2025, 2:36:53 AMJan 29
to okapi-users
Thanks so much Chase! Much appreciated 

Chase Tingley

unread,
Feb 1, 2025, 9:48:32 PMFeb 1
to Víctor Parra García, okapi-users
Hi Victor,

I was debugging this issue today, and I discovered that the issue is not quite what I thought it was, but also (good news) there's a workaround.

First of all, there are two problems with rainbow:
  1. The `-fc` parameter expects you to provide the name of the filter configuration without the `.fprm` suffix.  That is, use `-fc okf_xmlstream@html` instead of `-fc okf_xm...@html.fprm`.  This behavior is counterintuitive to me, I think we should fix it.
  2. A more serious issue: when you run Rainbow in batch (command-line) mode, it only seems to look for custom filter configurations in its default directory.  I work on Linux, so for me, the default directory is my home directory: /home/tingley.  When I was testing, I put your custom filter configuration into a test folder (/home/tingley/rainbow), and rainbow could not find it. However, once I copied the configuration into my home directory, it worked, as long as I used `okf_xmlstream@html` as described above.
On other platforms, that "default directory" on Rainbow is going to be whatever directory shows up at the bottom of the screen when you open Rainbow.  Rainbow does have a `-ir` command-line parameter that sets the root directory where it looks for source files.  However, this does not appear (in my debugging) to work for filter configurations.  I believe this is a bug.

Hopefully this will at least give you enough information to unblock you.
ct




Víctor Parra García

unread,
Feb 7, 2025, 8:49:06 AMFeb 7
to okapi-users
Thanks Chase, will try this asap!

Víctor Parra García

unread,
Feb 12, 2025, 2:34:32 PMFeb 12
to okapi-users
Hey Chase, just to confirm this is working smoother than butter now :D
Thanks so so so much!

Reply all
Reply to author
Forward
0 new messages