Useful Commands

Here we add useful commands.

MT commands

echo "Nu lea." | apertium -d . sme-smn

The program actually goes through 9 steps in order to make the translation (cf. this picture of the overall process, if you are a visual person).

In order to see what goes on, we may stop on any of the 9 steps:

  1. sme-smn-morph <=== full morphology
  2. sme-smn-disam <=== morphological disambiguation
  3. sme-smn-syntax <=== syntactical disambiguation
  4. sme-smn-biltrans <=== includes bidix
  5. sme-smn-lextor <=== lexical selection
  6. sme-smn-chunker <=== t1x transfer rules
  7. sme-smn-interchunk <=== t2x transfer rules
  8. sme-smn-postchunk <=== tx3 transfer rules
  9. sme-smn <=== full MT
  10. sme-smn-dgen <=== debugging-generation
  11. sme-smn-debug <=== debugging

We thus write echo "Nu lea." |apertium -d . sme-smn-morph etc. instead of only sme-smn, to get the output we want. With all the tags the output may be messy. A practical advice is to output one word on each line:

echo "Nu lea." | apertium -d . sme-smn-morph | tr ' ' '\n'

Here is the documentation for these modes

The regression test

(Regression tests are tests ensuring things do not get worse).

To run the tests, write:

t/update-latest t/regression-test

The number at the bottom indicates the number success/test.

To add tests, go to these pages, click "edit" and format as for the other sentences:

Cf. also the documentation.

Morphological analysis and generation

How to use the MT analysers and generators automorf (for analysis) and autogen (for generation)

Analyse North Saami:
echo ja|hfst-proc -a sme-smn.automorf.hfst
^ja/ja<cnjcoo>$

Generate North Saami:
echo '^ja<cnjcoo>$'|hfst-proc -d sme-smn.autogen.hfst
ja

Analyse Inari Saami:
echo já|hfst-proc -a smn-sme.automorf.hfst
^já/já<cnjcoo>$

Generate Inari Saami:
echo '^já<cnjcoo>$'|hfst-proc -d sme-smn.autogen.hfst
já