Package net.sf.okapi.steps.wordcount
Class CharacterCountStep
- java.lang.Object
-
- net.sf.okapi.common.pipeline.BasePipelineStep
-
- net.sf.okapi.steps.wordcount.CharacterCountStep
-
- All Implemented Interfaces:
IPipelineStep
public class CharacterCountStep extends BasePipelineStep
Character Counter pipeline step. The counter counts a number of characters in translatable text units. The count results are placed in a MetricsAnnotation structure (with the GMX TotalCharacterCount, WhiteSpaceCharacterCount, and PunctuationCharacterCount metrics set), attached to the respective event's resource (TEXT_UNIT, END_DOCUMENT, END_BATCH, END_BATCH_ITEM, END_SUBDOCUMENT, END_GROUP).
-
-
Constructor Summary
Constructors Constructor Description CharacterCountStep()
-
Method Summary
-
Methods inherited from class net.sf.okapi.common.pipeline.BasePipelineStep
cancel, destroy, getHelpLocation, getParameters, getSourceLocale, getTargetLocale, handleCustom, handleDocumentPart, handleEndSubfilter, handleEvent, handleMultiEvent, handlePipelineParameters, handleRawDocument, handleStartSubfilter, isDone, isLastOutputStep, setLastOutputStep, setParameters, setSourceLocale, setTargetLocale
-
-
-
-
Method Detail
-
getDescription
public String getDescription()
Description copied from interface:IPipelineStepGets 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:IPipelineStepGets the localizable name of this step.- Returns:
- the localizable name of this step.
-
saveCount
protected void saveCount(Metrics metrics, CharacterCounter.Counts count)
-
getBatchCount
public CharacterCounter.Counts getBatchCount()
-
getBatchItemCount
public CharacterCounter.Counts getBatchItemCount()
-
getDocumentCount
public CharacterCounter.Counts getDocumentCount()
-
getSubDocumentCount
public CharacterCounter.Counts getSubDocumentCount()
-
getGroupCount
public CharacterCounter.Counts getGroupCount()
-
saveToMetrics
protected void saveToMetrics(Event event, CharacterCounter.Counts count)
-
removeFromMetrics
protected void removeFromMetrics(IWithAnnotations res, String metricName)
-
removeFromMetrics
protected void removeFromMetrics(TextContainer textContainer, String metricName)
-
saveToMetrics
protected void saveToMetrics(TextContainer textContainer, CharacterCounter.Counts count)
-
saveToMetrics
protected void saveToMetrics(Segment seg, CharacterCounter.Counts count)
-
handleStartBatch
protected Event handleStartBatch(Event event)
Description copied from class:BasePipelineStepHandles theEventType.START_BATCHevent.- Overrides:
handleStartBatchin classBasePipelineStep- Parameters:
event- event to handle.- Returns:
- the event returned.
-
handleEndBatch
protected Event handleEndBatch(Event event)
Description copied from class:BasePipelineStepHandles theEventType.END_BATCHevent.- Overrides:
handleEndBatchin classBasePipelineStep- Parameters:
event- event to handle.- Returns:
- the event returned.
-
handleStartBatchItem
protected Event handleStartBatchItem(Event event)
Description copied from class:BasePipelineStepHandles theEventType.START_BATCH_ITEMevent.- Overrides:
handleStartBatchItemin classBasePipelineStep- Parameters:
event- event to handle.- Returns:
- the event returned.
-
handleEndBatchItem
protected Event handleEndBatchItem(Event event)
Description copied from class:BasePipelineStepHandles theEventType.END_BATCH_ITEMevent.- Overrides:
handleEndBatchItemin classBasePipelineStep- Parameters:
event- event to handle.- Returns:
- the event returned.
-
handleStartDocument
protected Event handleStartDocument(Event event)
Description copied from class:BasePipelineStepHandles theEventType.START_DOCUMENTevent.- Overrides:
handleStartDocumentin classBasePipelineStep- Parameters:
event- event to handle.- Returns:
- the event returned.
-
handleEndDocument
protected Event handleEndDocument(Event event)
Description copied from class:BasePipelineStepHandles theEventType.END_DOCUMENTevent.- Overrides:
handleEndDocumentin classBasePipelineStep- Parameters:
event- event to handle.- Returns:
- the event returned.
-
handleStartSubDocument
protected Event handleStartSubDocument(Event event)
Description copied from class:BasePipelineStepHandles theEventType.START_SUBDOCUMENTevent.- Overrides:
handleStartSubDocumentin classBasePipelineStep- Parameters:
event- event to handle.- Returns:
- the event returned.
-
handleEndSubDocument
protected Event handleEndSubDocument(Event event)
Description copied from class:BasePipelineStepHandles theEventType.END_SUBDOCUMENTevent.- Overrides:
handleEndSubDocumentin classBasePipelineStep- Parameters:
event- event to handle.- Returns:
- the event returned.
-
handleStartGroup
protected Event handleStartGroup(Event event)
Description copied from class:BasePipelineStepHandles theEventType.START_GROUPevent.- Overrides:
handleStartGroupin classBasePipelineStep- Parameters:
event- event to handle.- Returns:
- the event returned.
-
handleEndGroup
protected Event handleEndGroup(Event event)
Description copied from class:BasePipelineStepHandles theEventType.END_GROUPevent.- Overrides:
handleEndGroupin classBasePipelineStep- Parameters:
event- event to handle.- Returns:
- the event returned.
-
getSource
protected TextContainer getSource()
-
handleTextUnit
protected Event handleTextUnit(Event event)
Description copied from class:BasePipelineStepHandles theEventType.TEXT_UNITevent.- Overrides:
handleTextUnitin classBasePipelineStep- Parameters:
event- event to handle.- Returns:
- the event returned.
-
-