Difference between revisions of "Apertium-quality/Configuration"

From Apertium
Jump to navigation Jump to search
(Created page with '== Apertium Quality XML Configuration Format == === Introduction === The apertium quality configuration format is a fairly simple XML format for declaring which files are require…')
 
Line 44: Line 44:
 
</config>
 
</config>
 
</pre>
 
</pre>
  +
  +
== Regression Test Format ==
  +
  +
The format for creating regression tests is extremely simple. It is
  +
simply a Mediawiki template called <code>test</code>.
  +
  +
=== Example ===
  +
The parameters are pipe-delimited as follows:
  +
<pre>{{test|<language>|<original text>|<expected result>}}</pre> or <pre>{{test|<language>|<original text>|<expected result>|<comment>}}</pre>.
  +
  +
An example of usage:
  +
<pre>* {{test|fr|I am three years old.|J'ai trois ans.|Checks correct verb use}}</pre>
  +
  +
The above shows up on the wiki as:
  +
* {{test|fr|I am three years old.|J'ai trois ans.|Checks correct verb use}}.
  +
  +
  +
=== Usage as Regression Test ===
  +
In order to access your wiki page as a regression test, simply add Special:Export between wiki/ and your page name. For example, http://wiki.apertium.org/wiki/French_and_Breton/Regression_tests becomes http://wiki.apertium.org/wiki/Special:Export/French_and_Breton/Regression_tests. Simply paste that link as the parameter to aq-regtest and you're good to go.
  +
  +
<!--== Morph Test Format ==-->

Revision as of 03:23, 22 August 2011

Apertium Quality XML Configuration Format

Introduction

The apertium quality configuration format is a fairly simple XML format for declaring which files are required for running an automatic test, or however another tool uses the data.

The format is essentially as follows:

<config>
  <test-type>
    <content attribs=stuff />
  </test-type>
<config>

Currently supported test types:

  • coverage
  • tagging
  • regression
  • morph

Currently supported content elements:

  • test
  • corpus

For a more detailed overview, see the schema.

Example

Here is a template of the XML file:

<config xmlns="http://apertium.org/xml/quality/config/0.1">
</config>

This simple document takes several elements dependant on the type of file you want to declare for each test.

<config xmlns="http://apertium.org/xml/quality/config/0.1">
    <coverage>
        <corpus generator="gencrp.py" language="mt-he" path="relative-level-crp.txt" />
        <corpus generator='someotherscript.bash' language="mt-he" path="../belowhere.crp.txt />
    </coverage>
    <regression>
        <test language="mt-he" path="http://whatever/test.xml" />
        <test language="mt-he" path="localfile.xml" />
    </regression>
</config>

Regression Test Format

The format for creating regression tests is extremely simple. It is simply a Mediawiki template called test.

Example

The parameters are pipe-delimited as follows:

{{test|<language>|<original text>|<expected result>}}

or

{{test|<language>|<original text>|<expected result>|<comment>}}

.

An example of usage:

* {{test|fr|I am three years old.|J'ai trois ans.|Checks correct verb use}}

The above shows up on the wiki as:

  • (fr) I am three years old. → J'ai trois ans. :: Checks correct verb use.


Usage as Regression Test

In order to access your wiki page as a regression test, simply add Special:Export between wiki/ and your page name. For example, http://wiki.apertium.org/wiki/French_and_Breton/Regression_tests becomes http://wiki.apertium.org/wiki/Special:Export/French_and_Breton/Regression_tests. Simply paste that link as the parameter to aq-regtest and you're good to go.