Class NameSample

Namespace
NOpenNLP.Tools.Namefind
Assembly
NOpenNLP.Tools.dll

Class for holding names for a single unit of text.

public class NameSample
Inheritance
NameSample
Inherited Members

Constructors

NameSample(string?, string[], Span[]?, string[][]?, bool)

public NameSample(string? id, string[] sentence, Span[]? names, string[][]? additionalContext, bool clearAdaptiveData)

Parameters

id string
sentence string[]
names Span[]
additionalContext string[][]
clearAdaptiveData bool

NameSample(string[], Span[]?, bool)

public NameSample(string[] sentence, Span[]? names, bool clearAdaptiveData)

Parameters

sentence string[]
names Span[]
clearAdaptiveData bool

NameSample(string[], Span[]?, string[][]?, bool)

Initializes the current instance.

public NameSample(string[] sentence, Span[]? names, string[][]? additionalContext, bool clearAdaptiveData)

Parameters

sentence string[]

training sentence

names Span[]

the names contained in the sentence

additionalContext string[][]

the additional context or null

clearAdaptiveData bool

if true the adaptive data of the feature generators is cleared

Fields

DEFAULT_TYPE

The default type value when there is no type in training data.

public const string DEFAULT_TYPE = "default"

Field Value

string

Properties

AdditionalContext

public virtual string[][]? AdditionalContext { get; }

Property Value

string[][]

Id

public virtual string? Id { get; }

Property Value

string

IsClearAdaptiveDataSet

public virtual bool IsClearAdaptiveDataSet { get; }

Property Value

bool

Names

public virtual Span[] Names { get; }

Property Value

Span[]

Sentence

public virtual string[] Sentence { get; }

Property Value

string[]

Methods

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Parse(string, bool)

public static NameSample Parse(string taggedTokens, bool isClearAdaptiveData)

Parameters

taggedTokens string
isClearAdaptiveData bool

Returns

NameSample

Exceptions

IOException

if the tagged tokens cannot be parsed

Parse(string, string, bool)

public static NameSample Parse(string taggedTokens, string defaultType, bool isClearAdaptiveData)

Parameters

taggedTokens string
defaultType string
isClearAdaptiveData bool

Returns

NameSample

Exceptions

IOException

if the tagged tokens cannot be parsed

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.