public class FilterUtil extends Object
| Constructor and Description |
|---|
FilterUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
addCustomConfig(FilterConfigurationMapper fcMapper,
URL customConfig)
Adds to a given
FilterConfigurationMapper object the custom configuration
defined in the fprm file denoted by a given URL. |
static Event |
createDeepenSegmentationEvent()
|
static IFilter |
createFilter(Class<? extends IFilter> filterClass,
String configId)
Creates an instance of the filter for a given configuration identifier
and loads its corresponding parameters.
|
static IFilter |
createFilter(String configId)
Creates an instance of the filter for a given configuration identifier
and loads its corresponding parameters.
|
static IFilter |
createFilter(String configId,
URL... customConfigs)
Creates an instance of the filter for a given configuration identifier
and loads its corresponding parameters.
|
static IFilter |
createFilter(URL customConfig)
Creates an instance of the filter for a given URL of a fprm file defining a
custom configuration.
|
static void |
logDebugEvent(Event e,
String leader,
org.slf4j.Logger logger)
Logs an event at the debug level.
|
static void |
logDebugEvents(Iterable<Event> events,
org.slf4j.Logger logger)
Logs events at the debug level.
|
public static Event createDeepenSegmentationEvent()
Event with Custom resource and DeepenSegmentationAnnotaton.public static IFilter createFilter(String configId)
configId - the filter configuration identifier. Can only be one of default filter
configurations.IFilter object (with its parameters loaded) for the given
configuration identifier, or null if the object could not be created.public static IFilter createFilter(Class<? extends IFilter> filterClass, String configId)
filterClass - class of the filter.configId - the filter configuration identifier. Can be either one of Okapi
default filter configurations or one of the built-in configurations defined in
the filter class.IFilter object (with its parameters loaded) for the given
configuration identifier, or null if the object could not be created.public static IFilter createFilter(String configId, URL... customConfigs)
configId - the filter configuration identifier. Can be either one of Okapi
default filter configurations or one of the custom configurations defined in
the fprm files.customConfigs - a list of the URLs of fprm files defining custom configurations.
Every file name should follow the pattern of custom filter configurations,
i.e. contain a filter name like "okf_xmlstream@custom_config.fprm". The file extension
should be .fprm.IFilter object (with its parameters loaded) for the given
configuration identifier, or null if the object could not be created.public static String addCustomConfig(FilterConfigurationMapper fcMapper, URL customConfig)
FilterConfigurationMapper object the custom configuration
defined in the fprm file denoted by a given URL.fcMapper - the given FilterConfigurationMapper.customConfig - the URL of a fprm file defining the custom configuration
the filter should be loaded from. The file extension should be .fprm.
The file name should follow the pattern of custom filter configurations,
i.e. contain a filter name like "okf_xmlstream@custom_config.fprm".public static IFilter createFilter(URL customConfig)
customConfig - the URL of a fprm file defining the custom configuration
the filter should be loaded from. The file extension should be .fprm.
The file name should follow the pattern of custom filter configurations,
i.e. contain a filter name like "okf_xmlstream@custom_config.fprm".IFilter object (with its parameters loaded) for the given
configuration identifier, or null if the object could not be created.public static void logDebugEvents(Iterable<Event> events, org.slf4j.Logger logger)
events - The events to loglogger - The loggerCopyright © 2022. All rights reserved.