Package net.sf.okapi.steps.common
Class ResourceSimplifierStep
- java.lang.Object
-
- net.sf.okapi.common.pipeline.BasePipelineStep
-
- net.sf.okapi.steps.common.ResourceSimplifierStep
-
- All Implemented Interfaces:
AutoCloseable
,Function<Stream<Event>,Stream<Event>>
,IPipelineStep
public class ResourceSimplifierStep extends BasePipelineStep
Converts events, i.e. splits the generic skeleton of a given event resource into parts to contain no references. The skeleton parts are attached to newly created DOCUMENT_PART events. Original references are converted either to skeleton parts or TEXT_UNIT events. The sequence of DOCUMENT_PART and TEXT_UNIT events is packed into a single MULTI_EVENT event.For text units, the step removes the skeleton of a text unit, creating document parts for the skeleton parts before and after the content placeholder, and removes the remaining tu skeleton as holding the content placeholder as its only part.
-
-
Constructor Summary
Constructors Constructor Description ResourceSimplifierStep()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescription()
Gets a short localizable description of what this step does.String
getName()
Gets the localizable name of this step.Event
handleEvent(Event event)
Processes each event sent though the pipeline.void
setOutputEncoding(String outputEncoding)
void
setTargetLocale(LocaleId targetLocale)
void
setTargetLocales(List<LocaleId> targetLocales)
-
Methods inherited from class net.sf.okapi.common.pipeline.BasePipelineStep
cancel, destroy, getHelpLocation, getParameters, getSourceLocale, getTargetLocale, handleCustom, handleDocumentPart, handleEndBatch, handleEndBatchItem, handleEndDocument, handleEndGroup, handleEndSubDocument, handleEndSubfilter, handleMultiEvent, handlePipelineParameters, handleRawDocument, handleStartBatch, handleStartBatchItem, handleStartDocument, handleStartGroup, handleStartSubDocument, handleStartSubfilter, handleTextUnit, isDone, isLastOutputStep, setLastOutputStep, setParameters, setSourceLocale
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.okapi.common.pipeline.IPipelineStep
apply, close, handleStream
-
-
-
-
Method Detail
-
getDescription
public String getDescription()
Description copied from interface:IPipelineStep
Gets a short localizable description of what this step does.- Returns:
- the text of a short description of what this step does.
-
getName
public String getName()
Description copied from interface:IPipelineStep
Gets the localizable name of this step.- Returns:
- the localizable name of this step.
-
setTargetLocale
public void setTargetLocale(LocaleId targetLocale)
- Specified by:
setTargetLocale
in interfaceIPipelineStep
- Overrides:
setTargetLocale
in classBasePipelineStep
-
setOutputEncoding
public void setOutputEncoding(String outputEncoding)
-
handleEvent
public Event handleEvent(Event event)
Description copied from interface:IPipelineStep
Processes each event sent though the pipeline.- Specified by:
handleEvent
in interfaceIPipelineStep
- Overrides:
handleEvent
in classBasePipelineStep
- Parameters:
event
- the event to process.- Returns:
- the event to pass down the pipeline.
-
-