I just wanted to thank the folks who helped me and let everyone know I
found success using advice on this thread (and a little help in irc).  For
anyone else trying to do this, try the following:
* cd to the language directory that you want to do the translation for (for
me, it was en-fr)
* vi modes/en-fr.mode - this shows the list of commands and the order they
are executed as Flammie called out
* Test with different subsets of the commands from the modes file

eg echo "house" | apertium-...

You will need to remove the $1 and $2 that are in the modes file.  (I think
I needed to add a -g where one of those inputs were)

The first command in the mode file seems to provide a bunch of options for
the translation (in the case above, it was <n> and <vblex>).  The second
command filters to the most likely choice.  The rest of the commands
following that do the translation.  So you can start just after the second
command.

eg echo "^house<n><sg>$" | apertium-... starting from the 3rd command

Joel


On Tue, Sep 8, 2015 at 11:05 PM, Flammie Pirinen <[email protected]> wrote:

> 2015-09-08, Joel Wenzel sanoi:
>
> > Also, if there is a command line version, it would be much easier for
> > me. I can find things on the wiki that imply that there is a command
> > line but I'm having trouble finding solid docs for it?
>
> I guess the developer documentation might have more clues to
> command-line usage. I'd say, follow installation whichever method[1],
> download language data and compile it[2]. Once you have a translator
> running on commannd line, you can start reverse-engineering how to
> input a word-form and POS (and other stuff) to get a translation.
> At this point, the command-lines that are used for translation are
> simply stored in a directory called modes. E.g. for apertium-en-eo
> mentioned in the docs:
>
>  svn checkout
>  https://svn.code.sf.net/p/apertium/svn/trunk/apertium-eo-en
>  cd apertium-eo-en/ 2011  ./autogen.sh
>  make
>  cat modes/en-eo.mode
>
>     lt-proc /home/flammie/Koodit/apertium-eo-en/en-eo.automorf.bin
>     |apertium-tagger -g
>     $2 /home/flammie/Koodit/apertium-eo-en/en-eo.prob
>     |apertium-pretransfer|apertium-transfer
>     -n
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.genitive.t1x
> /home/flammie/Koodit/apertium-eo-en/en-eo.genitive.t1x.bin
>     |apertium-transfer
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.t1x
> /home/flammie/Koodit/apertium-eo-en/en-eo.t1x.bin
> /home/flammie/Koodit/apertium-eo-en/en-eo.autobil.bin
>     |apertium-interchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.antaux_t2x
> /home/flammie/Koodit/apertium-eo-en/en-eo.antaux_t2x.bin
>     |apertium-interchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.antaux2_t2x
> /home/flammie/Koodit/apertium-eo-en/en-eo.antaux2_t2x.bin
>     |apertium-interchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.t2x
> /home/flammie/Koodit/apertium-eo-en/en-eo.t2x.bin
>     |apertium-postchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.t3x  /
>
> So, check the first command:
>
>     lt-proc /home/flammie/Koodit/apertium-eo-en/en-eo.automorf.bin
>
>
> buffalo
> ^buffalo/*buffalo$
> house
> ^house/house<n><sg>$
> hit
>
> ^hit/hit<n><sg>/hit<vblex><inf>/hit<vblex><pres>/hit<vblex><past>/hit<vblex><pp>$
>
> Unfortunately, apertium's English dictionary does not have any entries
> for buffalo, but to show the other ones (my mail client totally
> destroys this one though, just ignore repeated |'s):
>
> $ echo "^house/house<n><sg>$" |apertium-tagger
> -g /home/flammie/Koodit/apertium-eo-en/en-eo.prob
> |apertium-pretransfer|apertium-transfer
> |-n /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.genitive.t1x
> /home/flammie/Koodit/apertium-eo-en/en-eo.genitive.t1x.bin
> ||apertium-transfer
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.t1x
> /home/flammie/Koodit/apertium-eo-en/en-eo.t1x.bin
> /home/flammie/Koodit/apertium-eo-en/en-eo.autobil.bin
> |||apertium-interchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.antaux_t2x
> /home/flammie/Koodit/apertium-eo-en/en-eo.antaux_t2x.bin
> ||||apertium-interchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.antaux2_t2x
> /home/flammie/Koodit/apertium-eo-en/en-eo.antaux2_t2x.bin
> |||||apertium-interchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.t2x
> /home/flammie/Koodit/apertium-eo-en/en-eo.t2x.bin
> ||||||apertium-postchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.t3x
> /home/flammie/Koodit/apertium-eo-en/en-eo.t3x.bin
> |||||||lt-proc -g /home/flammie/Koodit/apertium-eo-en/en-eo.autogen.bin
> |||||||domo $ echo "^hit/hit<n><sg>$" |apertium-tagger
> |||||||-g /home/flammie/Koodit/apertium-eo-en/en-eo.prob
> ||||||||apertium-pretransfer|apertium-transfer
> ||||||||-n
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.genitive.t1x
> /home/flammie/Koodit/apertium-eo-en/en-eo.genitive.t1x.bin
> |||||||||apertium-transfer
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.t1x
> /home/flammie/Koodit/apertium-eo-en/en-eo.t1x.bin
> /home/flammie/Koodit/apertium-eo-en/en-eo.autobil.bin
> ||||||||||apertium-interchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.antaux_t2x
> /home/flammie/Koodit/apertium-eo-en/en-eo.antaux_t2x.bin
> |||||||||||apertium-interchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.antaux2_t2x
> /home/flammie/Koodit/apertium-eo-en/en-eo.antaux2_t2x.bin
> ||||||||||||apertium-interchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.t2x
> /home/flammie/Koodit/apertium-eo-en/en-eo.t2x.bin
> |||||||||||||apertium-postchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.t3x
> /home/flammie/Koodit/apertium-eo-en/en-eo.t3x.bin
> ||||||||||||||lt-proc
> ||||||||||||||-g /home/flammie/Koodit/apertium-eo-en/en-eo.autogen.bin
> frapo
> $ echo "^hit/hit<vblex><inf>$" |apertium-tagger
> -g /home/flammie/Koodit/apertium-eo-en/en-eo.prob
> |apertium-pretransfer|apertium-transfer
> |-n /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.genitive.t1x
> /home/flammie/Koodit/apertium-eo-en/en-eo.genitive.t1x.bin
> ||apertium-transfer
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.t1x
> /home/flammie/Koodit/apertium-eo-en/en-eo.t1x.bin
> /home/flammie/Koodit/apertium-eo-en/en-eo.autobil.bin
> |||apertium-interchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.antaux_t2x
> /home/flammie/Koodit/apertium-eo-en/en-eo.antaux_t2x.bin
> ||||apertium-interchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.antaux2_t2x
> /home/flammie/Koodit/apertium-eo-en/en-eo.antaux2_t2x.bin
> |||||apertium-interchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.t2x
> /home/flammie/Koodit/apertium-eo-en/en-eo.t2x.bin
> ||||||apertium-postchunk
> /home/flammie/Koodit/apertium-eo-en/apertium-eo-en.en-eo.t3x
> /home/flammie/Koodit/apertium-eo-en/en-eo.t3x.bin
> |||||||lt-proc -g /home/flammie/Koodit/apertium-eo-en/en-eo.autogen.bin
> |||||||frapi
>
> Should be relatively straightforward, but if you need some help,
> there's an IRC channel #apertium on Freenode for live chats that may be
> of use.
>
> [1] <http://wiki.apertium.org/wiki/Installation>
> [2] <http://wiki.apertium.org/wiki/Minimal_installation_from_SVN>
> --
> Flammie, computer scientist bachelor + linguist master = computational
> linguist doctor, free software Finnish localiser,
> and more! <http://www.iki.fi/flammie/>
>
>
>
>
> ------------------------------------------------------------------------------
> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
> Get real-time metrics from all of your servers, apps and tools
> in one place.
> SourceForge users - Click here to start your Free Trial of Datadog now!
> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
> _______________________________________________
> Apertium-stuff mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/apertium-stuff
>
------------------------------------------------------------------------------
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to