Class SimpleStringDataSource<T extends Output<T>>
java.lang.Object
org.tribuo.data.text.TextDataSource<T>
org.tribuo.data.text.impl.SimpleTextDataSource<T>
org.tribuo.data.text.impl.SimpleStringDataSource<T>
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable,com.oracle.labs.mlrg.olcut.provenance.Provenancable<DataSourceProvenance>,Iterable<Example<T>>,ConfigurableDataSource<T>,DataSource<T>
A version of
SimpleTextDataSource that accepts a List of Strings.
Uses the parsing logic from SimpleTextDataSource.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.tribuo.data.text.impl.SimpleTextDataSource
SimpleTextDataSource.SimpleTextDataSourceProvenance -
Field Summary
FieldsModifier and TypeFieldDescriptionUsed because OLCUT doesn't support generic Iterables.Fields inherited from class org.tribuo.data.text.impl.SimpleTextDataSource
provenanceFields inherited from class org.tribuo.data.text.TextDataSource
data, extractor, outputFactory, path, preprocessors -
Constructor Summary
ConstructorsConstructorDescriptionSimpleStringDataSource(List<String> rawLines, OutputFactory<T> outputFactory, TextFeatureExtractor<T> extractor) Constructs a simple string data source from the supplied lines. -
Method Summary
Modifier and TypeMethodDescriptionprotected ConfiguredDataSourceProvenanceComputes the provenance.voidUsed by the OLCUT configuration system, and should not be called by external code.protected voidread()Reads the data from the Path.toString()Methods inherited from class org.tribuo.data.text.impl.SimpleTextDataSource
getProvenance, parseLineMethods inherited from class org.tribuo.data.text.TextDataSource
getOutputFactory, handleDoc, iteratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
rawLines
-
-
Constructor Details
-
SimpleStringDataSource
public SimpleStringDataSource(List<String> rawLines, OutputFactory<T> outputFactory, TextFeatureExtractor<T> extractor) Constructs a simple string data source from the supplied lines.- Parameters:
rawLines- The lines to parse.outputFactory- The output factory.extractor- The feature extractor.
-
-
Method Details
-
postConfig
public void postConfig()Used by the OLCUT configuration system, and should not be called by external code.- Specified by:
postConfigin interfacecom.oracle.labs.mlrg.olcut.config.Configurable- Overrides:
postConfigin classSimpleTextDataSource<T extends Output<T>>
-
toString
-
read
protected void read()Description copied from class:TextDataSourceReads the data from the Path.- Overrides:
readin classSimpleTextDataSource<T extends Output<T>>
-
cacheProvenance
Description copied from class:SimpleTextDataSourceComputes the provenance.- Overrides:
cacheProvenancein classSimpleTextDataSource<T extends Output<T>>- Returns:
- The provenance.
-