SemanticValue.Value Proprietà

Definizione

Proprietà di sola lettura che restituisce le informazioni contenute nell'elemento SemanticValuecorrente.

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à

Object

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

Esempio

L'esempio seguente viene usato per attraversare in modo ricorsivo e quindi visualizzare le informazioni (inclusa l'attendibilità) come o come nodi che formano la struttura ad albero della semantica usata per riconoscere TreeNodeCollection 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 un valore Value di e una proprietà pari a null Count zero.

Si applica a