Partager via


SemanticValue.Value Propriété

Définition

Propriété en lecture seule qui retourne les informations contenues dans le fichier actif SemanticValue.

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

Valeur de propriété

Retourne une Object instance contenant les informations stockées dans l’instance actuelle SemanticValue .

Exemples

L’exemple suivant permet de parcourir de manière récursive, puis d’afficher des informations (y compris la confiance) en tant TreeNodeCollectionque nœuds constituant la structure d’arborescence de la sémantique utilisée pour reconnaître une expression.

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

Remarques

Les résultats de reconnaissance qui n’utilisent pas l’analyse sémantique ont toujours une ValuenullCount propriété de zéro.

S’applique à