SemanticValue.Value プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
現在の 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);
}
注釈
セマンティック解析を利用しない認識結果には、常にnullのValueと 0 のCountプロパティがあります。