Condividi tramite


SemanticValue.Value Proprietà

Definizione

Proprietà di sola lettura che restituisce le informazioni contenute nell'oggetto corrente SemanticValue.

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

Valore della proprietà

Restituisce un'istanza Object contenente le informazioni archiviate nell'istanza corrente SemanticValue .

Esempio

L'esempio seguente viene usato per attraversare in modo ricorsivo e quindi visualizzare le informazioni (inclusa la confidenza) come TreeNodeCollectiono come nodi che costituiscono la struttura ad albero della semantica usata per riconoscere una frase.

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

Commenti

I risultati del riconoscimento che non usano l'analisi semantica hanno sempre una Value proprietà di null e Count pari a zero.

Si applica a