SemanticValue.Value Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A read-only property that returns the information contained in the current SemanticValue.
public:
property System::Object ^ Value { System::Object ^ get(); };
public object Value { get; }
member this.Value : obj
Public ReadOnly Property Value As Object
Returns an Object instance containing the information stored in the current SemanticValue instance.
The following example is used to recursively traverse and then display information (including confidence) as a TreeNodeCollection, or as the nodes making up the tree structure of the semantics used to recognize a phrase.
internal static void CreateSemanticsTreeNodes(
TreeNodeCollection nodes,
SemanticValue semantics,
String name)
{
string semanticsText =
String.Format(" {0} ( Confidence {1})", name,semantics.Confidence);
// Format integers as hexadecimal.
if (semantics.Value == null )
{
semanticsText = semanticsText + " = null";
}
else if (semantics.Value.GetType() == typeof(int))
{
semanticsText = String.Format("{0} = {1:X} ", semanticsText, semantics.Value);
}
else
{
semanticsText = semanticsText + " = " + semantics.Value.ToString();
}
TreeNode semanticsNode = new TreeNode(semanticsText);
foreach (KeyValuePair<String, SemanticValue> child in semantics)
{
CreateSemanticsTreeNodes(semanticsNode.Nodes, child.Value, child.Key);
}
nodes.Add(semanticsNode);
}
Recognition results which do not make use of semantic parsing always have a Value of null
and a Count property of zero.
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: