public class CategoryResolver extends Object
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.
ScopingReportStep.| Constructor and Description |
|---|
CategoryResolver(List<IPipelineStep> steps) |
| Modifier and Type | Method and Description |
|---|---|
void |
reset() |
void |
resolve(IResource res,
EventType eventType) |
void |
resolve(MetricsAnnotation ma,
boolean contributesInTotal) |
public CategoryResolver(List<IPipelineStep> steps)
public void reset()
public void resolve(MetricsAnnotation ma, boolean contributesInTotal)
Copyright © 2021. All rights reserved.