On 10 April 2011 21:36, [email protected] <[email protected]> wrote:
> "Rubén de la Fuente" <[email protected]> wrote:
>>Hi all
>>
>>I have recently download the Apertium for Windows build referred to
>>here:
>>http://wiki.apertium.org/wiki/Apertium_guide_for_Windows_users#Quick_test_that_it_works_2.
>>I have also downloaded documentation from March 10 2010, but couldn't
>>find
>>any solution there.
>>
>>I can get it to work using the echo statement: echo hola mundo |
>>apertium
>>es-ca.
>>
>>However, I get stuck when trying to use the following statement:
>>apertium
>>[-d datadir] [-f format] [-u] <direction> [in [out]]
>>
>>I have tried several variants with real examples, like $ apertium xml
>>>c:\mt\1.xml <c:\mt\1_out.xml but couldn't get it to work. Any idea
>>where I
>>am going wrong?
>
> You're not giving the -f option. There's also a slight difference needed for 
> cygwin (which Apertium on Windows uses) to get Unix-like paths - anywhere 
> where you give a Windows path needs to use the cygpath utility... instead of 
> c:\mt\1.xml you need to have $(cygpath c:\mt\1.xml) etc.
>
> It's awkward, but it's not easily fixable.
>
>>
>>Also, I wanted to ask if it was possible to translate batches of files,
>>instead of files one by one?
>
> You can write a shell script to do that. I can't give an example now because 
> I'm not at a computer, but I can send one in the morning.
>

Something like:

#!/bin/bash

for i in $@
do
    apertium -f html es-ca $(cygpath "$i") $(cygpath "$i.out")
done

should work.

-- 
<Sefam> Are any of the mentors around?
<jimregan> yes, they're the ones trolling you

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to