public class TextFieldProcessor extends Object implements FieldProcessor
FieldProcessor
which takes a text field and runs a TextPipeline
on it
to generate features.FieldProcessor.GeneratedFeatureType
NAMESPACE
Constructor and Description |
---|
TextFieldProcessor(String fieldName,
TextPipeline pipeline)
Constructs a field processor which uses the supplied text pipeline to process
the field value.
|
Modifier and Type | Method and Description |
---|---|
TextFieldProcessor |
copy(String newFieldName)
Note: the copy shares the text pipeline with the original.
|
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() |
List<ColumnarFeature> |
process(String value)
Processes the field value and generates a (possibly empty) list of
ColumnarFeature s. |
String |
toString() |
static List<ColumnarFeature> |
wrapFeatures(String fieldName,
List<Feature> inputFeatures)
Convert the
Feature s from a text pipeline into ColumnarFeature s with the right field name. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNumNamespaces
public TextFieldProcessor(String fieldName, TextPipeline pipeline)
fieldName
- The field name to read.pipeline
- The text processing pipeline to use.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 TextFieldProcessor copy(String newFieldName)
copy
in interface FieldProcessor
newFieldName
- The new field name for the copy.public static List<ColumnarFeature> wrapFeatures(String fieldName, List<Feature> inputFeatures)
Feature
s from a text pipeline into ColumnarFeature
s with the right field name.fieldName
- The field name to prepend.inputFeatures
- The features to convert.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.