Apertium has moved from SourceForge to GitHub.
If you have any questions, please come and talk to us on #apertium on irc.freenode.net or contact the GitHub migration team.

Multitrans

From Apertium
Jump to: navigation, search

multitrans is a program found in apertium-lex-tools, used as a helper when training (see Learning rules from parallel and non-parallel corpora).

Contents

[edit] modes

[edit] -b

This will output the source along with all target translations, like lt-proc -b.

Doing just

multitrans sl-tl.autobil.bin -b

is equivalent to doing lt-proc -b sl-tl.autobil.bin if the input consists of just correctly formatted lexical units (lt-proc -b fails on some misformattings that multitrans ignores).

[edit] -p

This will output the source side only, so used alone it turns into cat, but used with -t you can trim the tags to what bidix has.

So if bidix has an entry for kake<n><f>, you'll get

$ echo '^kake<n><f><sg><def>$' |multitrans nno-nob.autobil.bin -p -t
^kake<n><f><*>$

[edit] -m

This will output one entry on each line with a pair of translations, e.g.

$ echo '^obsternasig<adj><pst><sg><ind>$' |multitrans nor-eng.autobil.bin -m
.[][0 0].[]     ^obsternasig<adj><pst><sg><ind>/obstinate<adj><pst><sg><ind>$
.[][0 1].[]     ^obsternasig<adj><pst><sg><ind>/obdurate<adj><pst><sg><ind>$
.[][0 2].[]     ^obsternasig<adj><pst><sg><ind>/stubborn<adj><pst><sg><ind>$
.[][0 3].[]     ^obsternasig<adj><pst><sg><ind>/refractory<adj><pst><sg><ind>$

[edit] Options

[edit] -t

Trims off tags that don't appear in bidix, e.g. if bidix has an entry for kake<n><f>:

$ echo '^kake<n><f><sg><def>$' |multitrans nno-nob.autobil.bin -p -t
^kake<n><f><*>$

Can be used with -m or -b as well:

$ echo '^obsternasig<adj><pst><sg><ind>$' |multitrans nor-eng.autobil.bin -m -t
.[][0 0].[]     ^obsternasig<adj><*>/obstinate<adj><*>$
.[][0 1].[]     ^obsternasig<adj><*>/obdurate<adj><*>$
.[][0 2].[]     ^obsternasig<adj><*>/stubborn<adj><*>$
.[][0 3].[]     ^obsternasig<adj><*>/refractory<adj><*>$

$ echo '^obsternasig<adj><pst><sg><ind>$' |multitrans nor-eng.autobil.bin -b -t
^obsternasig<adj><*>/obstinate<adj><*>/obdurate<adj><*>/stubborn<adj><*>/refractory<adj><*>$

[edit] -f

what does this do?

[edit] -n

Numbers the lines. Doesn't seem to make a difference under the -m mode.

Personal tools