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:
AutoCloseable,Function<Stream<Event>,Stream<Event>>,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
-
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()
-
getName
public String getName()
-
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)
- Overrides:
handleStartBatchin classBasePipelineStep
-
handleEndBatch
protected Event handleEndBatch(Event event)
- Overrides:
handleEndBatchin classBasePipelineStep
-
handleStartBatchItem
protected Event handleStartBatchItem(Event event)
- Overrides:
handleStartBatchItemin classBasePipelineStep
-
handleEndBatchItem
protected Event handleEndBatchItem(Event event)
- Overrides:
handleEndBatchItemin classBasePipelineStep
-
handleStartDocument
protected Event handleStartDocument(Event event)
- Overrides:
handleStartDocumentin classBasePipelineStep
-
handleEndDocument
protected Event handleEndDocument(Event event)
- Overrides:
handleEndDocumentin classBasePipelineStep
-
handleStartSubDocument
protected Event handleStartSubDocument(Event event)
- Overrides:
handleStartSubDocumentin classBasePipelineStep
-
handleEndSubDocument
protected Event handleEndSubDocument(Event event)
- Overrides:
handleEndSubDocumentin classBasePipelineStep
-
handleStartGroup
protected Event handleStartGroup(Event event)
- Overrides:
handleStartGroupin classBasePipelineStep
-
handleEndGroup
protected Event handleEndGroup(Event event)
- Overrides:
handleEndGroupin classBasePipelineStep
-
getSource
protected TextContainer getSource()
-
handleTextUnit
protected Event handleTextUnit(Event event)
- Overrides:
handleTextUnitin classBasePipelineStep
-
-