public class RegexFieldProcessor extends Object implements FieldProcessor
FieldProcessor
which applies a regex to a field and generates ColumnarFeature
s based on the matches.Modifier and Type | Class and Description |
---|---|
static class |
RegexFieldProcessor.Mode
Matching mode.
|
FieldProcessor.GeneratedFeatureType
NAMESPACE
Constructor and Description |
---|
RegexFieldProcessor(String fieldName,
Pattern regex,
EnumSet<RegexFieldProcessor.Mode> modes)
Constructs a field processor which emits features when the field value matches the supplied regex.
|
RegexFieldProcessor(String fieldName,
String regex,
EnumSet<RegexFieldProcessor.Mode> modes)
Constructs a field processor which emits features when the field value matches the supplied regex.
|
Modifier and Type | Method and Description |
---|---|
RegexFieldProcessor |
copy(String newFieldName)
Returns a copy of this FieldProcessor bound to the supplied newFieldName.
|
FieldProcessor.GeneratedFeatureType |
getFeatureType()
Returns the feature type this FieldProcessor generates.
|
String |
getFieldName()
Gets the field name this FieldProcessor uses.
|
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance |
getProvenance() |
void |
postConfig()
Used by the OLCUT configuration system, and should not be called by external code.
|
List<ColumnarFeature> |
process(String value)
Processes the field value and generates a (possibly empty) list of
ColumnarFeature s. |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNumNamespaces
public RegexFieldProcessor(String fieldName, Pattern regex, EnumSet<RegexFieldProcessor.Mode> modes)
fieldName
- The field name to read.regex
- The regex to use for matching.modes
- The matching mode.public RegexFieldProcessor(String fieldName, String regex, EnumSet<RegexFieldProcessor.Mode> modes)
The regex is compiled on construction.
fieldName
- The field name to read.regex
- The regex to use for matching.modes
- The matching mode.public void postConfig()
postConfig
in interface com.oracle.labs.mlrg.olcut.config.Configurable
public String getFieldName()
FieldProcessor
getFieldName
in interface FieldProcessor
public List<ColumnarFeature> process(String value)
FieldProcessor
ColumnarFeature
s.process
in interface FieldProcessor
value
- The field value to process.ColumnarFeature
s.public FieldProcessor.GeneratedFeatureType getFeatureType()
FieldProcessor
getFeatureType
in interface FieldProcessor
public RegexFieldProcessor copy(String newFieldName)
FieldProcessor
copy
in interface FieldProcessor
newFieldName
- The new field name for the copy.public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.