public interface PepperManipulator extends PepperModule
A mapping task in the Pepper workflow is not a monolithic block. It consists of several smaller steps.
public MyModule() {
super("Name of the module");
setSupplierContact(URI.createURI("Contact address of the module's supplier"));
setSupplierHomepage(URI.createURI("homepage of the module"));
setDesc("A short description of what is the intention of this module, for instance which formats are importable. ");
}
public boolean isReadyToStart() {
return (true);
}
#createPepperMapper(SElementId) a PepperMapper object needs
to be initialized and returned. The PepperMapper is the major part
major part doing the mapping. It provides the methods
PepperMapper.mapSCorpus() to handle the mapping of a single
SCorpus object and PepperMapper.mapSDocument() to handle a
single SDocument object. Both methods are invoked by the Pepper
framework. The following snippet shows a dummy of that method:
public PepperMapper createPepperMapper(SElementId sElementId) {
PepperMapper mapper = new PepperMapperImpl() {
@Override
public DOCUMENT_STATUS mapSCorpus() {
// handling the mapping of a single corpus
// accessing the current file or folder
getResourceURI();
// returning, that the corpus was mapped successfully
return (DOCUMENT_STATUS.COMPLETED);
}
@Override
public DOCUMENT_STATUS mapSDocument() {
// handling the mapping of a single document
// accessing the current file or folder
getResourceURI();
// returning, that the document was mapped successfully
return (DOCUMENT_STATUS.COMPLETED);
}
};
return (mapper);
}
public void end() {
super.end();
// do some clean up like closing of streams etc.
}
ENDING_ALL_FILES, ENDING_FOLDER, ENDING_LEAF_FOLDER, ENDING_TAB, ENDING_TXT, ENDING_XMLcreatePepperMapper, done, done, end, getComponentContext, getCorpusGraph, getDesc, getFingerprint, getModuleController, getModuleType, getName, getProgress, getProgress, getProperties, getResources, getSaltProject, getSelfTestDesc, getStartProblems, getSupplierContact, getSupplierHomepage, getSymbolicName, getTemproraries, getVersion, isMultithreaded, isReadyToStart, proposeImportOrder, setCorpusGraph, setDesc, setIsMultithreaded, setPepperModuleController_basic, setPepperModuleController, setProperties, setResources, setSaltProject, setSupplierContact, setSupplierHomepage, setSymbolicName, setTemproraries, setVersion, start, startCopyright © 2009–2020 Humboldt-Universität zu Berlin, INRIA. All rights reserved.