Interface IFormatParameter

Namespace
NOpenNLP.Tools.Formats
Assembly
NOpenNLP.Tools.dll

Describes one command line parameter a corpus format accepts.

public interface IFormatParameter

Remarks

Authored for NOpenNLP; not part of the Apache OpenNLP source. Upstream describes a format's parameters with an interface whose getters carry @ParameterDescription and @OptionalParameter annotations, and ArgumentParser reflects over it to build a dynamic proxy. .NET has no dynamic proxy in the BCL, and this port drives the command line with System.CommandLine, so a parameter is described by data instead. The names, value names, descriptions and defaults carried here are copied verbatim from the upstream annotations, because they are the user-facing contract.

This lives in NOpenNLP.Tools rather than in the CLI project so the library can describe its formats without taking a dependency on System.CommandLine; the CLI translates these descriptors into options.

Properties

DefaultValue

The value used when an optional parameter is omitted, or null when upstream declares no default.

object? DefaultValue { get; }

Property Value

object

Description

The help text for this parameter, or an empty string when upstream gives none.

string Description { get; }

Property Value

string

IsOptional

Whether the user may omit this parameter.

bool IsOptional { get; }

Property Value

bool

Name

The option as the user types it, including the leading dash, i.e. -data.

string Name { get; }

Property Value

string

ValueName

The placeholder shown for the value in help, i.e. sampleData.

string ValueName { get; }

Property Value

string

ValueType

The value type. One of string, int, bool, FileInfo or Encoding, matching the types upstream's ArgumentParser accepts.

Type ValueType { get; }

Property Value

Type