Class AbstractEvaluatorTool<T>

Namespace
NOpenNLP.Tools.Cmdline
Assembly
nopennlp.dll

Base class for tools which read samples of type T from a stream of a named format.

public abstract class AbstractEvaluatorTool<T> : TypedCmdLineTool

Type Parameters

T
Inheritance
AbstractEvaluatorTool<T>
Derived
Inherited Members

Fields

factory

The factory for the selected format, available once the action runs.

protected IObjectStreamFactory<T>? factory

Field Value

IObjectStreamFactory<T>

sampleStream

The samples read from the selected format, available once the action runs.

protected IObjectStream<T>? sampleStream

Field Value

IObjectStream<T>

Methods

CreateCommand(string)

Builds the command that parses this tool's arguments and runs it.

public override Command CreateCommand(string commandName)

Parameters

commandName string

the name the user typed, which for a typed tool includes the .format suffix and so is not always Name

Returns

Command

GetFormatNames()

The format names registered for this tool's sample type, in registration order.

protected override IEnumerable<string> GetFormatNames()

Returns

IEnumerable<string>

GetFormatParameters(string)

The parameters the named format accepts, or null when it is not registered.

protected override IEnumerable<IFormatParameter>? GetFormatParameters(string format)

Parameters

format string

Returns

IEnumerable<IFormatParameter>

GetStreamFactory(string)

Resolves the factory for the selected format, or fails the way upstream does.

protected IObjectStreamFactory<T> GetStreamFactory(string format)

Parameters

format string

Returns

IObjectStreamFactory<T>

GetToolOptions()

The options this tool accepts, beyond the selected format's own.

protected abstract IEnumerable<Option> GetToolOptions()

Returns

IEnumerable<Option>

Run(ParseResult)

Runs the tool once its options and the format's have been parsed.

protected abstract void Run(ParseResult parseResult)

Parameters

parseResult ParseResult