The quotes are necessary for many separate cases across all of Linux,
macOS, and Windows, so we want to keep them in the mode files.
Here's how I handle it in OmegaT:
If there are no quotes, add them and convert ' to ":
https://github.com/TinoDidriksen/apertium-omegat-native/blob/master/src/com/tinodidriksen/omegat/apertiumnative/ApertiumNative.java#L210
Run it via native shell:
https://github.com/TinoDidriksen/apertium-omegat-native/blob/master/src/com/tinodidriksen/omegat/apertiumnative/ApertiumNative.java#L66
-- Tino Didriksen
On 2 June 2017 at 08:57, Xavi Ivars <[email protected]> wrote:
> For some time (not sure when it started to happen), mode files contain the
> filenames of the dictionaries/tagger data/.... quoted, like
>
> *lt-proc '/home/xavi/src/apertium/apertium-spa-cat/spa-cat.automorf.bin' |
> \*
> *cg-proc -w '/home/xavi/src/apertium/apertium-spa-cat/spa-cat.rlx.bin' | \*
> *apertium-tagger -g $2
> '/home/xavi/src/apertium/apertium-spa-cat/spa-cat.prob' *
>
>
> while previously, it was something like
>
> *lt-proc /home/xavi/src/apertium/apertium-es-ca/es-ca.automorf.bin | \*
> *apertium-tagger -g $2 /home/xavi/src/apertium/apertium-es-ca/es-ca.prob*
>
>
> That makes lttoolbox-java to fail to open the files. I think filenames
> should be "sanitized", for example here: https://apertium.
> projectjj.com/trac/browser/trunk/lttoolbox-java/src/org/
> apertium/tagger/Tagger.java#L222 (same happens for all other commands).
>
> But when running apertium-viewer in C++, it also fails. As even the C++
> mode of apertium-viewer uses parts of lttoolbox-java, my guess is that the
> error is more or less related, but I'm not familiar enough with the code
> and how java creates and handles native processes to be sure without
> spending more time.
>
> Meanwhile, as a workaround, is enough to remove the quotes from the mode
> files (making sure there are no whitespaces). Replacing single quotes with
> double quotes doesn't help either.
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff