SemanticValue Constructors

Definition

Initializes a new instance of the SemanticValue class.

Overloads

SemanticValue(Object)

Initializes a new instance of the SemanticValue class and specifies a semantic value.

SemanticValue(String, Object, Single)

Initializes a new instance of the SemanticValue class and specifies a semantic value, a key name, and a confidence level.

Remarks

Typically, you will not create SemanticValue objects explicitly, except to support the building of strongly-typed grammars.

SemanticValue(Object)

Source:
SemanticValue.cs
Source:
SemanticValue.cs
Source:
SemanticValue.cs

Initializes a new instance of the SemanticValue class and specifies a semantic value.

C#
public SemanticValue(object value);

Parameters

value
Object

The information to be stored in the SemanticValue object.

Remarks

There are no restrictions on the type of value to be stored.

An application can retrieve value by using the Value property on a SemanticValue instance.

The value of the Confidence property for the SemanticValue instance will be set to -1.

A SemanticValue constructed with this method cannot be referenced by key name.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

SemanticValue(String, Object, Single)

Source:
SemanticValue.cs
Source:
SemanticValue.cs
Source:
SemanticValue.cs

Initializes a new instance of the SemanticValue class and specifies a semantic value, a key name, and a confidence level.

C#
public SemanticValue(string keyName, object value, float confidence);

Parameters

keyName
String

A key that can be used to reference this SemanticValue instance.

value
Object

An object containing information to be stored in the SemanticValue object.

confidence
Single

A float containing an estimate of the certainty of semantic analysis.

Remarks

There are no restrictions on the type of value to be stored.

An application can retrieve value by using the Value property on a SemanticValue instance.

The confidence parameter (returned by the Confidence property on a SemanticValue instance), should be between 0.0 and 1.0.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)