SemanticValue 构造函数

定义

初始化 SemanticValue 类的新实例。Initializes a new instance of the SemanticValue class.

重载

SemanticValue(Object)

使用指定的语义值初始化 SemanticValue 类的新实例。Initializes a new instance of the SemanticValue class and specifies a semantic value.

SemanticValue(String, Object, Single)

初始化 SemanticValue 类的新实例并指定一个语义值、键名称和置信度。Initializes a new instance of the SemanticValue class and specifies a semantic value, a key name, and a confidence level.

注解

通常, 你不会显式SemanticValue创建对象, 但支持构建强类型的语法除外。Typically, you will not create SemanticValue objects explicitly, except to support the building of strongly-typed grammars.

SemanticValue(Object)

使用指定的语义值初始化 SemanticValue 类的新实例。Initializes a new instance of the SemanticValue class and specifies a semantic value.

public:
 SemanticValue(System::Object ^ value);
public SemanticValue (object value);
new System.Speech.Recognition.SemanticValue : obj -> System.Speech.Recognition.SemanticValue
Public Sub New (value As Object)

参数

value
Object

SemanticValue 对象要存储的信息。The information to be stored in the SemanticValue object.

注解

value要存储的类型没有任何限制。There are no restrictions on the type of value to be stored.

应用程序可以通过value使用SemanticValue实例上Value的属性来检索。An application can retrieve value by using the Value property on a SemanticValue instance.

SemanticValue实例的Confidence属性的值将设置为-1。The value of the Confidence property for the SemanticValue instance will be set to -1.

使用SemanticValue此方法构造的不能由键名称引用。A SemanticValue constructed with this method cannot be referenced by key name.

SemanticValue(String, Object, Single)

初始化 SemanticValue 类的新实例并指定一个语义值、键名称和置信度。Initializes a new instance of the SemanticValue class and specifies a semantic value, a key name, and a confidence level.

public:
 SemanticValue(System::String ^ keyName, System::Object ^ value, float confidence);
public SemanticValue (string keyName, object value, float confidence);
new System.Speech.Recognition.SemanticValue : string * obj * single -> System.Speech.Recognition.SemanticValue
Public Sub New (keyName As String, value As Object, confidence As Single)

参数

keyName
String

可用于引用此 SemanticValue 实例的密钥。A key that can be used to reference this SemanticValue instance.

value
Object

一个对象包含要存储在 SemanticValue 对象中的信息。An object containing information to be stored in the SemanticValue object.

confidence
Single

包含对语义分析的确定性进行估计的 floatA float containing an estimate of the certainty of semantic analysis.

注解

value要存储的类型没有任何限制。There are no restrictions on the type of value to be stored.

应用程序可以通过value使用SemanticValue实例上Value的属性来检索。An application can retrieve value by using the Value property on a SemanticValue instance.

参数 ( SemanticValue Confidence由实例的属性返回confidence ) 应介于0.0 和1.0 之间。The confidence parameter (returned by the Confidence property on a SemanticValue instance), should be between 0.0 and 1.0.

适用于