Pepper
3.6.0
A highly extensible plattform for conversion and manipulationoflinguisticdata.
|
TODO make some docu. More...
Inherited by org.corpus_tools.pepper.impl.PepperModuleImpl, org.corpus_tools.pepper.modules.PepperExporter, org.corpus_tools.pepper.modules.PepperImporter, and org.corpus_tools.pepper.modules.PepperManipulator.
Public Member Functions | |
PepperModuleDesc | getFingerprint () |
Returns a PepperModuleDesc object, which is a kind of a fingerprint of this PepperModule. More... | |
MODULE_TYPE | getModuleType () |
Returns the type of this module. More... | |
ComponentContext | getComponentContext () |
Returns the ComponentContext of the OSGi environment the bundle was started in. More... | |
String | getName () |
Returns the name of this module. More... | |
String | getVersion () |
Returns the version of this module. More... | |
void | setVersion (String value) |
Sets the version of this module. More... | |
String | getDesc () |
Returns a short description of this module. More... | |
void | setDesc (String desc) |
Sets a short description of this module. More... | |
URI | getSupplierContact () |
Returns a uri where to find more information about this module and where to find some contact information to contact the supplier. More... | |
void | setSupplierContact (URI eMail) |
Sets a uri where to find more information about this module and where to find some contact information to contact the supplier. More... | |
URI | getSupplierHomepage () |
Sets the URI to the homepage describing the functionality of the module. More... | |
void | setSupplierHomepage (URI hp) |
Returns the URI to the homepage describing the functionality of the module. More... | |
PepperModuleProperties | getProperties () |
Returns a PepperModuleProperties object containing properties to customize the behavior of this PepperModule. More... | |
void | setProperties (PepperModuleProperties properties) |
Sets thePepperModuleProperties object containing properties to customize the behavior of this PepperModule. More... | |
ModuleController | getModuleController () |
Returns the container and controller object for the current module. More... | |
void | setPepperModuleController (ModuleController value) |
Sets the container and controller object for the current module. More... | |
void | setPepperModuleController_basic (ModuleController value) |
Sets the container and controller object for the current module. More... | |
SaltProject | getSaltProject () |
Returns the SaltProject object, which is filled, manipulated or exported by the current module. More... | |
void | setSaltProject (SaltProject value) |
Sets the SaltProject object, which is filled, manipulated or exported by the current module. More... | |
SCorpusGraph | getCorpusGraph () |
Returns the SCorpusGraph object which is filled, manipulated or exported by the current module. More... | |
void | setCorpusGraph (SCorpusGraph value) |
Sets the SCorpusGraph object which is filled, manipulated or exported by the current module. More... | |
URI | getResources () |
Returns the path of the folder which might contain resources for a Pepper module. More... | |
void | setResources (URI value) |
Sets the resource folder used by getResources(). More... | |
URI | getTemproraries () |
TODO make docu. | |
void | setTemproraries (URI value) |
TODO make docu. | |
String | getSymbolicName () |
Returns the symbolic name of this OSGi bundle. More... | |
void | setSymbolicName (String value) |
Sets the symbolic name of this OSGi bundle. More... | |
Collection< String > | getStartProblems () |
If isReadyToStart() has returned false, this method returns a list of reasons why this module is not ready to start. More... | |
boolean | isReadyToStart () throws PepperModuleNotReadyException |
This method is called by the pepper framework after initializing this object and directly before start processing. More... | |
void | setIsMultithreaded (boolean isMultithreaded) |
Sets whether this PepperModule is able to run multithreaded. More... | |
boolean | isMultithreaded () |
Returns whether this PepperModule is able to run multithreaded. More... | |
void | start () throws PepperModuleException |
Starts the conversion process. More... | |
void | start (Identifier sElementId) throws PepperModuleException |
This method is called by the method start(). More... | |
PepperMapper | createPepperMapper (Identifier sElementId) |
OVERRIDE THIS METHOD FOR CUSTOMIZED MAPPING. More... | |
List< Identifier > | proposeImportOrder (SCorpusGraph sCorpusGraph) |
This method could be overridden, to make a proposal for the import order of SDocument objects. More... | |
Double | getProgress (String globalId) |
This method is invoked by the Pepper framework, to get the current progress concerning the SDocument object corresponding to the given Identifier in percent. More... | |
Double | getProgress () |
This method is invoked by the Pepper framework, to get the current total progress of all SDocument objects being processed by this module. More... | |
void | end () throws PepperModuleException |
This method is called by the pepper framework at the end of a conversion process. More... | |
void | done (PepperMapperController controller) |
This method is called by a PepperMapperController object to notify the PepperModule object, that the mapping is done. More... | |
void | done (Identifier identifier, DOCUMENT_STATUS result) |
This method is called by a PepperMapperController object to notify the PepperModule object, that the mapping for this object is done. More... | |
SelfTestDesc | getSelfTestDesc () |
This method is called by the Pepper framework to run an integration test for module. More... | |
Static Public Attributes | |
static final String | ENDING_FOLDER = "FOLDER" |
A string specifying a value for a folder as ending. More... | |
static final String | ENDING_LEAF_FOLDER = "LEAF_FOLDER" |
A string specifying a value for a leaf folder as ending. More... | |
static final String | ENDING_XML = "xml" |
Ending for an xml file. More... | |
static final String | ENDING_TXT = "txt" |
Ending for an txt file. More... | |
static final String | ENDING_TAB = "tab" |
Ending for an tab file. More... | |
static final String | ENDING_ALL_FILES = "ALL_FILES" |
All kinds of file endings. | |
TODO make some docu.
PepperMapper org.corpus_tools.pepper.modules.PepperModule.createPepperMapper | ( | Identifier | sElementId | ) |
OVERRIDE THIS METHOD FOR CUSTOMIZED MAPPING.
This method creates a customized PepperMapper object and returns it. You can here do some additional initialisations. Thinks like setting the Identifier of the SDocument or SCorpus object and the URI resource is done by the framework (or more in detail in method start()). The parameter sElementId
, if a PepperMapper object should be created in case of the object to map is either an SDocument object or an SCorpus object of the mapper should be initialized differently.
Note: Override this method.
sElementId | Identifier of the SCorpus or SDocument to be processed. |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl, org.corpus_tools.pepper.modules.coreModules.SaltXMLExporter, org.corpus_tools.pepper.modules.coreModules.DoNothingImporter, org.corpus_tools.pepper.modules.coreModules.TextImporter, org.corpus_tools.pepper.modules.coreModules.TextExporter, org.corpus_tools.pepper.modules.coreModules.SaltValidator, org.corpus_tools.pepper.modules.coreModules.DOTManipulator, org.corpus_tools.pepper.modules.coreModules.DOTExporter, org.corpus_tools.pepper.modules.coreModules.DoNothingManipulator, org.corpus_tools.pepper.modules.coreModules.SaltXMLImporter, and org.corpus_tools.pepper.modules.coreModules.DoNothingExporter.
void org.corpus_tools.pepper.modules.PepperModule.done | ( | Identifier | identifier, |
DOCUMENT_STATUS | result | ||
) |
This method is called by a PepperMapperController object to notify the PepperModule object, that the mapping for this object is done.
identifier | |
result |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.done | ( | PepperMapperController | controller | ) |
This method is called by a PepperMapperController object to notify the PepperModule object, that the mapping is done.
controller | The object which is done with its job |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.end | ( | ) | throws PepperModuleException |
This method is called by the pepper framework at the end of a conversion process.
Means after all objects ( SDocument and SCorpus objects) have been processed. This method can be used to do some clean up (e.g. to close streams etc.).
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
ComponentContext org.corpus_tools.pepper.modules.PepperModule.getComponentContext | ( | ) |
Returns the ComponentContext of the OSGi environment the bundle was started in.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
SCorpusGraph org.corpus_tools.pepper.modules.PepperModule.getCorpusGraph | ( | ) |
Returns the SCorpusGraph object which is filled, manipulated or exported by the current module.
The SCorpusGraph object is contained in the salt project getSaltProject().
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
String org.corpus_tools.pepper.modules.PepperModule.getDesc | ( | ) |
Returns a short description of this module.
Please support some information, for the user, of what task this module does.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
PepperModuleDesc org.corpus_tools.pepper.modules.PepperModule.getFingerprint | ( | ) |
Returns a PepperModuleDesc object, which is a kind of a fingerprint of this PepperModule.
This fingerprint for instance contains information like the name, the version of this module or information about the supplier.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
ModuleController org.corpus_tools.pepper.modules.PepperModule.getModuleController | ( | ) |
Returns the container and controller object for the current module.
The ModuleController object is a kind of communicator between a PepperModule and the pepper framework.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
MODULE_TYPE org.corpus_tools.pepper.modules.PepperModule.getModuleType | ( | ) |
Returns the type of this module.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
String org.corpus_tools.pepper.modules.PepperModule.getName | ( | ) |
Returns the name of this module.
In most cases, the name somehow describes the task of the module.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
Double org.corpus_tools.pepper.modules.PepperModule.getProgress | ( | ) |
This method is invoked by the Pepper framework, to get the current total progress of all SDocument objects being processed by this module.
A valid value return must be between 0 and 1. This method can be overridden by a derived PepperModule class. If this method is not overridden, it will return null.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
Double org.corpus_tools.pepper.modules.PepperModule.getProgress | ( | String | globalId | ) |
This method is invoked by the Pepper framework, to get the current progress concerning the SDocument object corresponding to the given Identifier in percent.
A valid value return must be between 0 and 1.
Note: In case, you have overridden the method start(Identifier) or start(), please also override this method, because it accesses an internal list of all mappers, which initialized in start(Identifier).
globalID | identifier of the requested SDocument object, note, that this is not the Identifier. |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
PepperModuleProperties org.corpus_tools.pepper.modules.PepperModule.getProperties | ( | ) |
Returns a PepperModuleProperties object containing properties to customize the behavior of this PepperModule.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
URI org.corpus_tools.pepper.modules.PepperModule.getResources | ( | ) |
Returns the path of the folder which might contain resources for a Pepper module.
This is the folder, which is delivered as part of the modules zip. Usually a Pepper module is a zip file containing a jar file and a folder having the same name as the jar file. In default configuration all files of folder "./src/main/resources" are copied to the resource folder.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
SaltProject org.corpus_tools.pepper.modules.PepperModule.getSaltProject | ( | ) |
Returns the SaltProject object, which is filled, manipulated or exported by the current module.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
SelfTestDesc org.corpus_tools.pepper.modules.PepperModule.getSelfTestDesc | ( | ) |
This method is called by the Pepper framework to run an integration test for module.
When the method returns null, it means that no integration test is supported. Otherwise, the SelfTestDesc object needs to provide an input corpus path and an output corpus path.
When this module is:
The simplest way to create a test description is:
return new IntegrationTestDesc(inputPath, outputPath);
When this module is an importer or a manipulator the method SelfTestDesc#compare(SaltProject, SaltProject) is called to compare output salt project with expected salt project. When the module is an exporter the method SelfTestDesc#compare(URI, URI) is called to compare the created output folder with an expected one. By default this method checks whether the file structure and each file is equal.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl, org.corpus_tools.pepper.modules.coreModules.SaltXMLImporter, org.corpus_tools.pepper.modules.coreModules.SaltXMLExporter, org.corpus_tools.pepper.modules.coreModules.TextImporter, org.corpus_tools.pepper.modules.coreModules.SaltValidator, org.corpus_tools.pepper.modules.coreModules.TextExporter, org.corpus_tools.pepper.modules.coreModules.DoNothingImporter, org.corpus_tools.pepper.modules.coreModules.DoNothingManipulator, org.corpus_tools.pepper.modules.coreModules.DoNothingExporter, org.corpus_tools.pepper.modules.coreModules.DOTExporter, and org.corpus_tools.pepper.modules.coreModules.DOTManipulator.
Collection<String> org.corpus_tools.pepper.modules.PepperModule.getStartProblems | ( | ) |
If isReadyToStart() has returned false, this method returns a list of reasons why this module is not ready to start.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
URI org.corpus_tools.pepper.modules.PepperModule.getSupplierContact | ( | ) |
Returns a uri where to find more information about this module and where to find some contact information to contact the supplier.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
URI org.corpus_tools.pepper.modules.PepperModule.getSupplierHomepage | ( | ) |
Sets the URI to the homepage describing the functionality of the module.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
String org.corpus_tools.pepper.modules.PepperModule.getSymbolicName | ( | ) |
Returns the symbolic name of this OSGi bundle.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
String org.corpus_tools.pepper.modules.PepperModule.getVersion | ( | ) |
Returns the version of this module.
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
boolean org.corpus_tools.pepper.modules.PepperModule.isMultithreaded | ( | ) |
Returns whether this PepperModule is able to run multithreaded.
The behavior only should be set by the module itself via calling setIsMultithreaded(boolean).
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
boolean org.corpus_tools.pepper.modules.PepperModule.isReadyToStart | ( | ) | throws PepperModuleNotReadyException |
This method is called by the pepper framework after initializing this object and directly before start processing.
Initializing means setting properties PepperModuleProperties, setting temporary files, resources etc. . returns false or throws an exception in case of PepperModule instance is not ready for any reason
This method is also called, when Pepper is in self-test mode, to check if module is correctly instantiated.
The default implementation checks:
When overriding this method, please call super.isReadyToStart() first and in case a problem occured add it to the list getStartProblems().
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
List<Identifier> org.corpus_tools.pepper.modules.PepperModule.proposeImportOrder | ( | SCorpusGraph | sCorpusGraph | ) |
This method could be overridden, to make a proposal for the import order of SDocument objects.
Overriding this method is useful, in case of the order matters in the specific mapping of this PepperModule . In this case a influencing the import order can decrease the processing time. If you do not want to influence the order, just return an empty list, or don't override this method.
In case you want to override this method, you can return a value for each passed SCorpusGraph.
OVERRIDE THIS METHOD FOR CUSTOMIZED MAPPING.
sCorpusGraph | the SCorpusGraph object for which the order could be proposed |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.setCorpusGraph | ( | SCorpusGraph | value | ) |
Sets the SCorpusGraph object which is filled, manipulated or exported by the current module.
The SCorpusGraph object is contained in the salt project getSaltProject(). Note: This method only should be called by the pepper framework.
value | the new value of the 'SCorpus Graph' attribute. |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.setDesc | ( | String | desc | ) |
Sets a short description of this module.
Please support some information, for the user, of what task this module does.
desc | a short description of the task of this module |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.setIsMultithreaded | ( | boolean | isMultithreaded | ) |
Sets whether this PepperModule is able to run multithreaded.
This method only should be called by the module itself.
isThreaded | true, if module can run in multithread mode. |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.setPepperModuleController | ( | ModuleController | value | ) |
Sets the container and controller object for the current module.
The ModuleController object is a kind of communicator between a PepperModule and the pepper framework. Also calls the inverse method ModuleController#setPepperModule_basic(PepperModule) . Note, this method only should be called by pepper framework.
value | the new value of the 'Pepper Module Controller' container reference. |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.setPepperModuleController_basic | ( | ModuleController | value | ) |
Sets the container and controller object for the current module.
The ModuleController object is a kind of communicator between a PepperModule and the pepper framework. Note, this method only should be called by pepper framework.
value | the new value of the 'Pepper Module Controller' container reference. |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.setProperties | ( | PepperModuleProperties | properties | ) |
Sets thePepperModuleProperties object containing properties to customize the behavior of this PepperModule.
Please make sure, that this method is called in constructor of your module. If not, a general PepperModuleProperties object is created by the pepper framework and will be initialized. This means, when calling this method later, all properties for customizing the module will be overridden.
properties |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.setResources | ( | URI | value | ) |
Sets the resource folder used by getResources().
This method should only be invoked by the Pepper framework. The documentation of getResources() for more details.
value | path to resource folder |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.setSaltProject | ( | SaltProject | value | ) |
Sets the SaltProject object, which is filled, manipulated or exported by the current module.
Note: This method only should be called by the pepper framework.
value | the new value of the 'Salt Project' attribute. |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.setSupplierContact | ( | URI | ) |
Sets a uri where to find more information about this module and where to find some contact information to contact the supplier.
uri | contact address like eMail address or homepage address |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.setSupplierHomepage | ( | URI | hp | ) |
Returns the URI to the homepage describing the functionality of the module.
hp | URI to the homepage |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.setSymbolicName | ( | String | value | ) |
Sets the symbolic name of this OSGi bundle.
This value is set automatically inside the activate method, which is implemented in PepperModuleImpl class. If you want to manipulate that method. make sure to set the symbolic name and make sure, that it is set to the bundles symbolic name.
value | the new value of the 'Symbolic Name' attribute. |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.setVersion | ( | String | value | ) |
Sets the version of this module.
The version normally is set internally, this method only exists for dependency injection, by the modules project itself. But this method is never called by the pepper framework.
value | the new value of the 'Version' attribute. |
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
void org.corpus_tools.pepper.modules.PepperModule.start | ( | ) | throws PepperModuleException |
Starts the conversion process.
This method is the main method of a pepper module. If this method is not overridden, it will call start(Identifier) for each SDocument and SCorpus object being contained in the set SCorpusGraph. This is done in a multithreaded way by default. Note: When your module should not run in multithreaded mode, call setIsMultithreaded(boolean) .
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl, org.corpus_tools.pepper.impl.PepperImporterImpl, org.corpus_tools.pepper.modules.coreModules.SaltXMLExporter, org.corpus_tools.pepper.impl.PepperExporterImpl, and org.corpus_tools.pepper.modules.coreModules.DoNothingExporter.
void org.corpus_tools.pepper.modules.PepperModule.start | ( | Identifier | sElementId | ) | throws PepperModuleException |
This method is called by the method start().
This is the only call in Pepper. You do not need to override this method, in case of you are happy with the default behavior. In default, this method invokes a multithreaded process, which creates PepperMapper objects for each given Identifier object, to process the corresponding SDocument or SCorpus object. The PepperMapper objects are not created by the method itself, the creation is delegated to createPepperMapper(Identifier), which has to be overridden. Default initializations are done there (for more details, please take a look into the doc of that method). Further this method links the created PepperMapper object to a PepperMapperController object and makes sure, that the process runs in a by Pepper controlled manner.
Note: When your module should not run in multithreaded mode, call setIsMultithreaded(boolean).
Note: In case of you override this method, please make sure to also override the following methods:
Implemented in org.corpus_tools.pepper.impl.PepperModuleImpl.
|
static |
A string specifying a value for a folder as ending.
This is useful for setTypeOfResource(URI), to determine, that even a folder can be mapped to a resource.Can be used by importers to be put in collection getDocumentEndings() or getCorpusEndings()
|
static |
A string specifying a value for a leaf folder as ending.
This is useful for setTypeOfResource(URI), to determine, that even a leaf folder can be mapped to a resource. Can be used by importers to be put in collection getDocumentEndings() or getCorpusEndings()
|
static |
Ending for an tab file.
Can be used by importers to be put in collection getDocumentEndings() or getCorpusEndings()
|
static |
Ending for an txt file.
Can be used by importers to be put in collection getDocumentEndings() or getCorpusEndings()
|
static |
Ending for an xml file.
Can be used by importers to be put in collection getDocumentEndings() or getCorpusEndings()