Class CategoryResolver
- java.lang.Object
-
- net.sf.okapi.steps.wordcount.categorized.CategoryResolver
-
public class CategoryResolver extends Object
Helper class for removal of categories that are superseded by other higher-ranked categories from the same category group.If a text fragment has been matched against more than one category, and the matching categories belong to the same group, e.g. all are GMX-categories, then only one category is left, namely the one ranked the highest. Ranking of categories is defined by the sequence of category handler steps in a list passed to the constructor.
The class modifies count-related metrics in a MetricsAnnotation attached to a given resource. The superseded metrics are removed, but if they contained non-zero values, those values are remembered in the removedCategories hash map to later be subtracted from accumulated counts in resources of END_BATCH_ITEM and END_BATCH events.
-
-
Constructor Summary
Constructors Constructor Description CategoryResolver(List<IPipelineStep> steps)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidreset()voidresolve(IResource res, EventType eventType)voidresolve(MetricsAnnotation ma, boolean contributesInTotal)
-
-
-
Constructor Detail
-
CategoryResolver
public CategoryResolver(List<IPipelineStep> steps)
-
-
Method Detail
-
reset
public void reset()
-
resolve
public void resolve(MetricsAnnotation ma, boolean contributesInTotal)
-
-