Class AbstractSampleStreamFactory<T>
Base class for sample stream factories.
public abstract class AbstractSampleStreamFactory<T> : IObjectStreamFactory<T>
Type Parameters
T
- Inheritance
-
AbstractSampleStreamFactory<T>
- Implements
- Derived
- Inherited Members
Properties
Lang
The language of the samples this factory produces.
public virtual string Lang { get; }
Property Value
Parameters
The parameters this format accepts, in the order they should be listed in help.
public abstract IEnumerable<IFormatParameter> Parameters { get; }
Property Value
Methods
CheckInputFile(string, FileInfo)
Checks that inFile exists, is not a directory, and is readable,
failing the way the command line tools do when it is not.
protected static void CheckInputFile(string name, FileInfo inFile)
Parameters
namestringthe name used to refer to the file in the error message; it should start with a capital letter
inFileFileInfo
Create(IFormatParameterValues)
Creates the IObjectStream<T> over the corpus named by
values.
public abstract IObjectStream<T> Create(IFormatParameterValues values)
Parameters
valuesIFormatParameterValuesthe parsed values of Parameters
Returns
- IObjectStream<T>
a stream of samples
CreateInputStreamFactory(FileInfo)
Creates an IInputStreamFactory over file,
failing the way the command line tools do when it cannot be read.
protected static IInputStreamFactory CreateInputStreamFactory(FileInfo file)
Parameters
fileFileInfo
Returns
ReadData(IFormatParameterValues)
Opens the -data file named by values as a stream of
lines, decoded with -encoding.
protected static IObjectStream<string?> ReadData(IFormatParameterValues values)
Parameters
valuesIFormatParameterValues