Difference between revisions of "Install quick tests"

From Apertium
Jump to navigation Jump to search
(Created page with "More convincing if you have a language pair on the computer somewhere :) == If you only compiled Apertium core == One way to test you have something, immediately, it to try i...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
More convincing if you have a language pair on the computer somewhere :)
 
More convincing if you have a language pair on the computer somewhere :)
   
== If you only compiled Apertium core ==
+
== If you only compiled/installed Apertium core ==
One way to test you have something, immediately, it to try invoke a tool. Without language data you can't see a translation, but you can see the help. Try,
+
One way to test you have something, immediately, it to try invoke a tool. After a core has been installed, this should work for both packaged and compiled Apertium. Without language data you can't see a translation, but you can see the help. Try,
   
 
<pre>
 
<pre>
Line 11: Line 11:
   
   
== If you downloaded and compiled a language pair==
+
== If you OS-installed a language pair ==
  +
...by packaging, or manual install. You may have done this because you do not want to develop.
You downloaded and compiled language data, but did not install.
 
  +
  +
<pre>
 
echo 'This is a test sentence' | apertium xxx-yyy
  +
</pre>
  +
 
e.g.
  +
  +
<pre>
  +
echo 'This is a test sentence' | apertium eo-en
  +
</pre>
  +
 
This command does not need to use the <code>-d</code> switch. The language pair is installed, so Apertium can find it, whatever directory you're in.
  +
  +
 
== If you compiled a language pair with no install ==
  +
You probably want to develop a language pair.
   
 
Go into the bilingual dictionary and try,
 
Go into the bilingual dictionary and try,
Line 29: Line 45:
   
   
  +
== If you installed a language pair by packaging, or manual install ==
+
== If you installed new (empty) language directories ==
You may have done this as a quick test for a compiled core. Or because you do not want to develop, only use the language data. Or you used packaging, and installed, as a test, a pair.
 
  +
They can still be tested. New language directories created by 'apertium-init' contain a single word, the English word 'house'. So,
  +
  +
=== To test a new language directory (or a monodix in a pair) ===
  +
You must have run <code>./autogen</code> and <code>make</code> first.
  +
  +
Go into the monodix, then try invoking a mode e.g. 'tagger',
   
 
<pre>
 
<pre>
echo 'This is a test sentence' | apertium xxx-yyy
+
echo house | apertium -d . xxx-tagger
</pre>
+
</pre>
   
  +
Should return,
e.g.
 
   
 
<pre>
 
<pre>
  +
^house/house<n><attr>/house<n><sg>$^./.<sent>$
echo 'This is a test sentence' | apertium eo-en
 
</pre>
+
</pre>
   
  +
(If the word had not been recognised, this command would return <code><pre>^horse/*horse$^./.<sent></pre></code>)
This command does not need to use the <code>-d</code> switch. The language pair is installed, so Apertium can find it, whatever directory you're in.
 
  +
  +
=== To test a new bidix ===
  +
You must have run <code>./autogen.sh --with-lang1=../apertium-XXX --with-lang2=../apertium-YYY</code> and <code>make langs</code> first.
  +
  +
Go into the bidix. Then you can test in the same way as you would test a pair downloaded for compiling, except the only word available is 'house',
  +
  +
<pre>
  +
echo house | apertium -d . xxx-yyy
  +
</pre>
   
   

Latest revision as of 06:02, 24 April 2017

More convincing if you have a language pair on the computer somewhere :)

If you only compiled/installed Apertium core[edit]

One way to test you have something, immediately, it to try invoke a tool. After a core has been installed, this should work for both packaged and compiled Apertium. Without language data you can't see a translation, but you can see the help. Try,

lt-proc

You should see the help files?


If you OS-installed a language pair[edit]

...by packaging, or manual install. You may have done this because you do not want to develop.

 echo 'This is a test sentence' | apertium xxx-yyy

e.g.

 echo 'This is a test sentence' | apertium eo-en

This command does not need to use the -d switch. The language pair is installed, so Apertium can find it, whatever directory you're in.


If you compiled a language pair with no install[edit]

You probably want to develop a language pair.

Go into the bilingual dictionary and try,

echo 'This is a test sentence.' | apertium -d . xxx-yyy

e.g.

 echo 'This is a test sentence' | apertium -d . eo-en

The -d . means "use the language data in this directory".


If you installed new (empty) language directories[edit]

They can still be tested. New language directories created by 'apertium-init' contain a single word, the English word 'house'. So,

To test a new language directory (or a monodix in a pair)[edit]

You must have run ./autogen and make first.

Go into the monodix, then try invoking a mode e.g. 'tagger',

echo house | apertium -d . xxx-tagger

Should return,

^house/house<n><attr>/house<n><sg>$^./.<sent>$

(If the word had not been recognised, this command would return

^horse/*horse$^./.<sent>

)

To test a new bidix[edit]

You must have run ./autogen.sh --with-lang1=../apertium-XXX --with-lang2=../apertium-YYY and make langs first.

Go into the bidix. Then you can test in the same way as you would test a pair downloaded for compiling, except the only word available is 'house',

echo house | apertium -d . xxx-yyy