次の方法で共有


SemanticValue.Value プロパティ

定義

現在の SemanticValueに含まれる情報を返す読み取り専用プロパティ。

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

プロパティ値

現在のSemanticValue インスタンスに格納されている情報を含むObject インスタンスを返します。

次の例は、再帰的に走査し、情報 (信頼度を含む) を TreeNodeCollectionとして、または語句を認識するために使用されるセマンティクスのツリー構造を構成するノードとして表示するために使用されます。

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

注釈

セマンティック解析を利用しない認識結果には、常にnullValueと 0 のCountプロパティがあります。

適用対象