Pepper
3.6.0
A highly extensible plattform for conversion and manipulationoflinguisticdata.
|
The fitness check ensures, that a module fits into the Pepper platform. It checks a set of features describing whether a module implements all fields and methods which should be implemented. Some of the features are required (health features) and some are optional (fitness features). When the module does not pass at least one of the health features, the overall module fitness is set to critical. When all health features are passed and at least one fitness is missed, the overall module fitness is healthy. When the module passes all features, the overall status is fit.
To run the fitness check for an installed module run: pepper>fitness
The health features are required features and ensure that a module is runnable inside Pepper.
This health feature indicates whether a module's name is set. When your module fails this check, call the module's super constructor and pass the module's name:
This health feature indicates whether a module is runnable on the Pepper platform. To check this, the function org.corpus_tools.pepper.modules.PepperModule.isReadyToStart() is called. When your module fails this check, it means that this method returned false.
When the module provides a self test, this health feature indicates whether the self test was passed. A self test is a test setup to check whether the module is runnable within a Pepper instance (similar to a system integration test). Therefore the module needs to provide a corpus as an input and an expected corpus. The output corpus then is compared to the expected corpus. When your module fails this check, it means that the self test has not been passed. For more information on self tests check section HAS_SELFTEST.
When the module is an importer, provides a self test and overrides the isImportable() method, this health feature indicates whether the method isImportable() returned 1.0 for the provided input corpus. A self test is a test setup to check whether the module is runnable within a Pepper instance (similar to a system integration test). Therefore the module needs to provide a corpus as an input and an expected corpus. The output corpus then is compared to the expected corpus. When your module fails this check, it means that the self test has not been passed. For more information on self tests check section HAS_SELFTEST.
When the module provides a self test, this health feature indicates whether the provided input and expected corpus is valid. A self test is a test setup to check whether the module is runnable within a Pepper instance (similar to a system integration test). Therefore the module needs to provide a corpus as an input and an expected corpus. The output corpus then is compared to the expected corpus. When your module fails this check, it means that the self test has not been passed. For more information on self tests check section HAS_SELFTEST.
The fitness features are optional and must not necessarily be passed to run a module in Pepper. But they ensure, that the module implements a kind of a standard and supports information which are helpful to the user.
This health feature indicates whether a supplier contact is set. When your module fails this check, call the following method in the mpodule's constructor:
This health feature indicates whether a supplier homepage is set. When your module fails this check, call the following method in the mpodule's constructor:
This health feature indicates whether a description for the module is set. When your module fails this check, call the following method in the mpodule's constructor:
When the module is an importer or an exporter, this fitness feature indicates whether the module provides a list containing the format(s) it supports. When your module fails this check, call the following method in the mpodule's constructor:
This fitness feature indicates whether the module provides a self test. A self test is a test setup to check whether the module is runnable within a Pepper instance (similar to a system integration test). Therefore the module needs to provide a corpus as an input and an expected corpus. The output corpus then is compared to the expected corpus. When your module fails thus check, provide an input corpus, an expected corpus and override the following method:
When your module is an importer, the input corpus path should contain a corpus in the format you want to import and the expected corpus path should contain a corpus in Salt format. When your module is a manipulator, the input and the export corpus path corpus should contain a corpus in Salt format. When your module is an exporter, the input corpus path should contain a corpus in the Salt format and the expected corpus path should contain a corpus in the format you want to export.
When the expected and the output corpora are in Salt format, Pepper will use the comparison of Salt modules to check wether they are isomorph. When the expected and the output corpora ar in any other format, Pepper will compare them by file comparison. For XML files the XMLUnit library is used.
To have more control on the comparison check the documentation in org.corpus_tools.pepper.core.SelfTestDesc and override one of the following methods (which depends on your particular case):
When the module is an importer, this fitness feature indicates whether the module implements the method org.corpus_tools.pepper.modules.PepperImporter.isImportable(URI corpusPath). This method is called by Pepper and returns if a corpus is located at the given location is importable by this importer. When your module fails this check, override the isImportable() method. The following is a snippet from the SaltXMLImporter, which determine that corpora which contain Salt files are analyzed as importable.