Package net.sf.okapi.steps.wordcount
Class WordCountStep
- java.lang.Object
-
- net.sf.okapi.common.pipeline.BasePipelineStep
-
- net.sf.okapi.steps.wordcount.common.BaseCountStep
-
- net.sf.okapi.steps.wordcount.common.TokenCountStep
-
- net.sf.okapi.steps.wordcount.WordCountStep
-
- All Implemented Interfaces:
AutoCloseable,Function<Stream<Event>,Stream<Event>>,IPipelineStep
public class WordCountStep extends TokenCountStep
Word Counter pipeline step. The counter counts a number of words in translatable text units. The count results are placed in a MetricsAnnotation structure (with the GMX TotalWordCount metric set), attached to the respective event's resource (TEXT_UNIT, END_DOCUMENT, END_BATCH, END_BATCH_ITEM, END_SUBDOCUMENT, END_GROUP).- Version:
- 0.1 06.07.2009
-
-
Constructor Summary
Constructors Constructor Description WordCountStep()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longcount(Segment segment, LocaleId locale)protected longcount(TextContainer textContainer, LocaleId locale)protected booleancountOnlyTranslatable()StringgetDescription()StringgetMetric()StringgetName()protected String[]getTokenNames()-
Methods inherited from class net.sf.okapi.steps.wordcount.common.TokenCountStep
countInTextUnit, filterTokens, getTokens, getTokens
-
Methods inherited from class net.sf.okapi.steps.wordcount.common.BaseCountStep
getBatchCount, getBatchItemCount, getDocumentCount, getGroupCount, getSource, getSubDocumentCount, handleEndBatch, handleEndBatchItem, handleEndDocument, handleEndGroup, handleEndSubDocument, handleStartBatch, handleStartBatchItem, handleStartDocument, handleStartGroup, handleStartSubDocument, handleTextUnit, removeFromMetrics, removeFromMetrics, removeFromMetrics, saveCount, saveToMetrics, saveToMetrics, saveToMetrics
-
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
-
-
-
-
Field Detail
-
METRIC
public static final String METRIC
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMetric
public String getMetric()
- Specified by:
getMetricin classBaseCountStep
-
getTokenNames
protected String[] getTokenNames()
- Specified by:
getTokenNamesin classTokenCountStep
-
countOnlyTranslatable
protected boolean countOnlyTranslatable()
- Specified by:
countOnlyTranslatablein classBaseCountStep
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceIPipelineStep- Specified by:
getDescriptionin classBaseCountStep
-
getName
public String getName()
- Specified by:
getNamein interfaceIPipelineStep- Specified by:
getNamein classBaseCountStep
-
count
protected long count(Segment segment, LocaleId locale)
- Overrides:
countin classTokenCountStep
-
count
protected long count(TextContainer textContainer, LocaleId locale)
- Overrides:
countin classTokenCountStep
-
-