SemanticValue.Value Egenskap

Definition

En skrivskyddad egenskap som returnerar informationen i den aktuella SemanticValue.

public:
 property System::Object ^ Value { System::Object ^ get(); };
public object? Value { get; }
public object Value { get; }
member this.Value : obj
Public ReadOnly Property Value As Object

Egenskapsvärde

Returnerar en Object instans som innehåller den information som lagras i den aktuella SemanticValue instansen.

Exempel

Följande exempel används för att rekursivt passera och sedan visa information (inklusive konfidens) som en TreeNodeCollection, eller som noderna som utgör trädstrukturen för semantiken som används för att identifiera en fras.

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);
}

Kommentarer

Igenkänningsresultat som inte använder semantisk parsning har alltid en Value av null och en Count egenskap på noll.

Gäller för