Class BaseCountStep
- java.lang.Object
-
- net.sf.okapi.common.pipeline.BasePipelineStep
-
- net.sf.okapi.steps.wordcount.common.BaseCountStep
-
- All Implemented Interfaces:
IPipelineStep
- Direct Known Subclasses:
AltAnnotationBasedCountStep,GMXProtectedWordCountStep,TokenCountStep
public abstract class BaseCountStep extends BasePipelineStep
Base abstract class for different counter steps (word count step, character count step, etc.).
-
-
Constructor Summary
Constructors Constructor Description BaseCountStep()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract longcount(Segment segment, LocaleId locale)protected abstract longcount(TextContainer textContainer, LocaleId locale)protected abstract longcountInTextUnit(ITextUnit textUnit)protected abstract booleancountOnlyTranslatable()longgetBatchCount()longgetBatchItemCount()abstract StringgetDescription()longgetDocumentCount()longgetGroupCount()abstract StringgetMetric()abstract StringgetName()protected TextContainergetSource()longgetSubDocumentCount()protected EventhandleEndBatch(Event event)protected EventhandleEndBatchItem(Event event)protected EventhandleEndDocument(Event event)protected EventhandleEndGroup(Event event)protected EventhandleEndSubDocument(Event event)protected EventhandleStartBatch(Event event)protected EventhandleStartBatchItem(Event event)protected EventhandleStartDocument(Event event)protected EventhandleStartGroup(Event event)protected EventhandleStartSubDocument(Event event)protected EventhandleTextUnit(Event event)protected voidremoveFromMetrics(IWithAnnotations res, String metricName)protected voidremoveFromMetrics(Segment seg, String metricName)protected voidremoveFromMetrics(TextContainer textContainer, String metricName)protected voidsaveCount(Metrics metrics, long count)protected voidsaveToMetrics(Event event, long count)protected voidsaveToMetrics(Segment seg, long count)protected voidsaveToMetrics(TextContainer textContainer, long count)-
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
-
getName
public abstract String getName()
-
getDescription
public abstract String getDescription()
-
getMetric
public abstract String getMetric()
-
count
protected abstract long count(TextContainer textContainer, LocaleId locale)
-
countInTextUnit
protected abstract long countInTextUnit(ITextUnit textUnit)
-
countOnlyTranslatable
protected abstract boolean countOnlyTranslatable()
-
saveCount
protected void saveCount(Metrics metrics, long count)
-
getBatchCount
public long getBatchCount()
-
getBatchItemCount
public long getBatchItemCount()
-
getDocumentCount
public long getDocumentCount()
-
getSubDocumentCount
public long getSubDocumentCount()
-
getGroupCount
public long getGroupCount()
-
saveToMetrics
protected void saveToMetrics(Event event, long count)
-
removeFromMetrics
protected void removeFromMetrics(IWithAnnotations res, String metricName)
-
removeFromMetrics
protected void removeFromMetrics(TextContainer textContainer, String metricName)
-
saveToMetrics
protected void saveToMetrics(TextContainer textContainer, long count)
-
saveToMetrics
protected void saveToMetrics(Segment seg, long 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
-
-