Export (0) Print
Expand All

SemanticValue Class

Represents the semantic organization of a recognized phrase.

System.Object
  System.Speech.Recognition.SemanticValue

Namespace:  System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)

[SerializableAttribute]
public sealed class SemanticValue : IDictionary<string, SemanticValue>, 
	ICollection<KeyValuePair<string, SemanticValue>>, IEnumerable<KeyValuePair<string, SemanticValue>>, 
	IEnumerable

The SemanticValue type exposes the following members.

  NameDescription
Public methodSemanticValue(Object)Initializes a new instance of the SemanticValue class and specifies a semantic value.
Public methodSemanticValue(String, Object, Single)Initializes a new instance of the SemanticValue class and specifies a semantic value, a key name, and a confidence level.
Top

  NameDescription
Public propertyConfidenceReturns a relative measure of the certainty as to the correctness of the semantic parsing that returned the current instance of SemanticValue.
Public propertyCountReturns the number of child SemanticValue objects under the current SemanticValue instance.
Public propertyItemReturns child SemanticValue instances that belong to the current SemanticValue.
Public propertyValueA read-only property that returns the information contained in the current SemanticValue.
Top

  NameDescription
Public methodContainsIndicates whether the current SemanticValue instance collection contains a specific key and a specific instance of SemanticValue expressed as a key/value pair.
Public methodContainsKeyIndicates whether the current SemanticValue instance collection contains a child SemanticValue instance with a given key string.
Public methodEquals (Overrides Object.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCode (Overrides Object.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public Extension MethodAggregate<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, KeyValuePair<String, SemanticValue>, KeyValuePair<String, SemanticValue>>)Overloaded. Applies an accumulator function over a sequence. (Defined by Enumerable.)
Public Extension MethodAggregate<KeyValuePair<String, SemanticValue>, TAccumulate>(TAccumulate, Func<TAccumulate, KeyValuePair<String, SemanticValue>, TAccumulate>)Overloaded. Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. (Defined by Enumerable.)
Public Extension MethodAggregate<KeyValuePair<String, SemanticValue>, TAccumulate, TResult>(TAccumulate, Func<TAccumulate, KeyValuePair<String, SemanticValue>, TAccumulate>, Func<TAccumulate, TResult>)Overloaded. Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. (Defined by Enumerable.)
Public Extension MethodAll<KeyValuePair<String, SemanticValue>>Determines whether all elements of a sequence satisfy a condition. (Defined by Enumerable.)
Public Extension MethodAny<KeyValuePair<String, SemanticValue>>()Overloaded. Determines whether a sequence contains any elements. (Defined by Enumerable.)
Public Extension MethodAny<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Boolean>)Overloaded. Determines whether any element of a sequence satisfies a condition. (Defined by Enumerable.)
Public Extension MethodAsEnumerable<KeyValuePair<String, SemanticValue>>Returns the input typed as IEnumerable<T>. (Defined by Enumerable.)
Public Extension MethodAsParallel()Overloaded. Enables parallelization of a query. (Defined by ParallelEnumerable.)
Public Extension MethodAsParallel<KeyValuePair<String, SemanticValue>>()Overloaded. Enables parallelization of a query. (Defined by ParallelEnumerable.)
Public Extension MethodAsQueryable()Overloaded. Converts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodAsQueryable<KeyValuePair<String, SemanticValue>>()Overloaded. Converts a generic IEnumerable<T> to a generic IQueryable<T>. (Defined by Queryable.)
Public Extension MethodAverage<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Decimal>>)Overloaded. Computes the average of a sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Double>>)Overloaded. Computes the average of a sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Int32>)Overloaded. Computes the average of a sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Int32>>)Overloaded. Computes the average of a sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Int64>)Overloaded. Computes the average of a sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Int64>>)Overloaded. Computes the average of a sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Single>)Overloaded. Computes the average of a sequence of Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Single>>)Overloaded. Computes the average of a sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Double>)Overloaded. Computes the average of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Decimal>)Overloaded. Computes the average of a sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodCast<TResult>Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodConcat<KeyValuePair<String, SemanticValue>>Concatenates two sequences. (Defined by Enumerable.)
Public Extension MethodContains<KeyValuePair<String, SemanticValue>>(KeyValuePair<String, SemanticValue>)Overloaded. Determines whether a sequence contains a specified element by using the default equality comparer. (Defined by Enumerable.)
Public Extension MethodContains<KeyValuePair<String, SemanticValue>>(KeyValuePair<String, SemanticValue>, IEqualityComparer<KeyValuePair<String, SemanticValue>>)Overloaded. Determines whether a sequence contains a specified element by using a specified IEqualityComparer<T>. (Defined by Enumerable.)
Public Extension MethodCount<KeyValuePair<String, SemanticValue>>()Overloaded. Returns the number of elements in a sequence. (Defined by Enumerable.)
Public Extension MethodCount<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Boolean>)Overloaded. Returns a number that represents how many elements in the specified sequence satisfy a condition. (Defined by Enumerable.)
Public Extension MethodDefaultIfEmpty<KeyValuePair<String, SemanticValue>>()Overloaded. Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty. (Defined by Enumerable.)
Public Extension MethodDefaultIfEmpty<KeyValuePair<String, SemanticValue>>(KeyValuePair<String, SemanticValue>)Overloaded. Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty. (Defined by Enumerable.)
Public Extension MethodDistinct<KeyValuePair<String, SemanticValue>>()Overloaded. Returns distinct elements from a sequence by using the default equality comparer to compare values. (Defined by Enumerable.)
Public Extension MethodDistinct<KeyValuePair<String, SemanticValue>>(IEqualityComparer<KeyValuePair<String, SemanticValue>>)Overloaded. Returns distinct elements from a sequence by using a specified IEqualityComparer<T> to compare values. (Defined by Enumerable.)
Public Extension MethodElementAt<KeyValuePair<String, SemanticValue>>Returns the element at a specified index in a sequence. (Defined by Enumerable.)
Public Extension MethodElementAtOrDefault<KeyValuePair<String, SemanticValue>>Returns the element at a specified index in a sequence or a default value if the index is out of range. (Defined by Enumerable.)
Public Extension MethodExcept<KeyValuePair<String, SemanticValue>>(IEnumerable<KeyValuePair<String, SemanticValue>>)Overloaded. Produces the set difference of two sequences by using the default equality comparer to compare values. (Defined by Enumerable.)
Public Extension MethodExcept<KeyValuePair<String, SemanticValue>>(IEnumerable<KeyValuePair<String, SemanticValue>>, IEqualityComparer<KeyValuePair<String, SemanticValue>>)Overloaded. Produces the set difference of two sequences by using the specified IEqualityComparer<T> to compare values. (Defined by Enumerable.)
Public Extension MethodFirst<KeyValuePair<String, SemanticValue>>()Overloaded. Returns the first element of a sequence. (Defined by Enumerable.)
Public Extension MethodFirst<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Boolean>)Overloaded. Returns the first element in a sequence that satisfies a specified condition. (Defined by Enumerable.)
Public Extension MethodFirstOrDefault<KeyValuePair<String, SemanticValue>>()Overloaded. Returns the first element of a sequence, or a default value if the sequence contains no elements. (Defined by Enumerable.)
Public Extension MethodFirstOrDefault<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Boolean>)Overloaded. Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. (Defined by Enumerable.)
Public Extension MethodGroupBy<KeyValuePair<String, SemanticValue>, TKey>(Func<KeyValuePair<String, SemanticValue>, TKey>)Overloaded. Groups the elements of a sequence according to a specified key selector function. (Defined by Enumerable.)
Public Extension MethodGroupBy<KeyValuePair<String, SemanticValue>, TKey>(Func<KeyValuePair<String, SemanticValue>, TKey>, IEqualityComparer<TKey>)Overloaded. Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer. (Defined by Enumerable.)
Public Extension MethodGroupBy<KeyValuePair<String, SemanticValue>, TKey, TElement>(Func<KeyValuePair<String, SemanticValue>, TKey>, Func<KeyValuePair<String, SemanticValue>, TElement>)Overloaded. Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function. (Defined by Enumerable.)
Public Extension MethodGroupBy<KeyValuePair<String, SemanticValue>, TKey, TResult>(Func<KeyValuePair<String, SemanticValue>, TKey>, Func<TKey, IEnumerable<KeyValuePair<String, SemanticValue>>, TResult>)Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. (Defined by Enumerable.)
Public Extension MethodGroupBy<KeyValuePair<String, SemanticValue>, TKey, TElement>(Func<KeyValuePair<String, SemanticValue>, TKey>, Func<KeyValuePair<String, SemanticValue>, TElement>, IEqualityComparer<TKey>)Overloaded. Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function. (Defined by Enumerable.)
Public Extension MethodGroupBy<KeyValuePair<String, SemanticValue>, TKey, TResult>(Func<KeyValuePair<String, SemanticValue>, TKey>, Func<TKey, IEnumerable<KeyValuePair<String, SemanticValue>>, TResult>, IEqualityComparer<TKey>)Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer. (Defined by Enumerable.)
Public Extension MethodGroupBy<KeyValuePair<String, SemanticValue>, TKey, TElement, TResult>(Func<KeyValuePair<String, SemanticValue>, TKey>, Func<KeyValuePair<String, SemanticValue>, TElement>, Func<TKey, IEnumerable<TElement>, TResult>)Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function. (Defined by Enumerable.)
Public Extension MethodGroupBy<KeyValuePair<String, SemanticValue>, TKey, TElement, TResult>(Func<KeyValuePair<String, SemanticValue>, TKey>, Func<KeyValuePair<String, SemanticValue>, TElement>, Func<TKey, IEnumerable<TElement>, TResult>, IEqualityComparer<TKey>)Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function. (Defined by Enumerable.)
Public Extension MethodGroupJoin<KeyValuePair<String, SemanticValue>, TInner, TKey, TResult>(IEnumerable<TInner>, Func<KeyValuePair<String, SemanticValue>, TKey>, Func<TInner, TKey>, Func<KeyValuePair<String, SemanticValue>, IEnumerable<TInner>, TResult>)Overloaded. Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys. (Defined by Enumerable.)
Public Extension MethodGroupJoin<KeyValuePair<String, SemanticValue>, TInner, TKey, TResult>(IEnumerable<TInner>, Func<KeyValuePair<String, SemanticValue>, TKey>, Func<TInner, TKey>, Func<KeyValuePair<String, SemanticValue>, IEnumerable<TInner>, TResult>, IEqualityComparer<TKey>)Overloaded. Correlates the elements of two sequences based on key equality and groups the results. A specified IEqualityComparer<T> is used to compare keys. (Defined by Enumerable.)
Public Extension MethodIntersect<KeyValuePair<String, SemanticValue>>(IEnumerable<KeyValuePair<String, SemanticValue>>)Overloaded. Produces the set intersection of two sequences by using the default equality comparer to compare values. (Defined by Enumerable.)
Public Extension MethodIntersect<KeyValuePair<String, SemanticValue>>(IEnumerable<KeyValuePair<String, SemanticValue>>, IEqualityComparer<KeyValuePair<String, SemanticValue>>)Overloaded. Produces the set intersection of two sequences by using the specified IEqualityComparer<T> to compare values. (Defined by Enumerable.)
Public Extension MethodJoin<KeyValuePair<String, SemanticValue>, TInner, TKey, TResult>(IEnumerable<TInner>, Func<KeyValuePair<String, SemanticValue>, TKey>, Func<TInner, TKey>, Func<KeyValuePair<String, SemanticValue>, TInner, TResult>)Overloaded. Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys. (Defined by Enumerable.)
Public Extension MethodJoin<KeyValuePair<String, SemanticValue>, TInner, TKey, TResult>(IEnumerable<TInner>, Func<KeyValuePair<String, SemanticValue>, TKey>, Func<TInner, TKey>, Func<KeyValuePair<String, SemanticValue>, TInner, TResult>, IEqualityComparer<TKey>)Overloaded. Correlates the elements of two sequences based on matching keys. A specified IEqualityComparer<T> is used to compare keys. (Defined by Enumerable.)
Public Extension MethodLast<KeyValuePair<String, SemanticValue>>()Overloaded. Returns the last element of a sequence. (Defined by Enumerable.)
Public Extension MethodLast<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Boolean>)Overloaded. Returns the last element of a sequence that satisfies a specified condition. (Defined by Enumerable.)
Public Extension MethodLastOrDefault<KeyValuePair<String, SemanticValue>>()Overloaded. Returns the last element of a sequence, or a default value if the sequence contains no elements. (Defined by Enumerable.)
Public Extension MethodLastOrDefault<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Boolean>)Overloaded. Returns the last element of a sequence that satisfies a condition or a default value if no such element is found. (Defined by Enumerable.)
Public Extension MethodLongCount<KeyValuePair<String, SemanticValue>>()Overloaded. Returns an Int64 that represents the total number of elements in a sequence. (Defined by Enumerable.)
Public Extension MethodLongCount<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Boolean>)Overloaded. Returns an Int64 that represents how many elements in a sequence satisfy a condition. (Defined by Enumerable.)
Public Extension MethodMax<KeyValuePair<String, SemanticValue>>()Overloaded. Returns the maximum value in a generic sequence. (Defined by Enumerable.)
Public Extension MethodMax<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Decimal>>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value. (Defined by Enumerable.)
Public Extension MethodMax<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Double>>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Double value. (Defined by Enumerable.)
Public Extension MethodMax<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Int32>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Int32 value. (Defined by Enumerable.)
Public Extension MethodMax<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Int32>>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Int32 value. (Defined by Enumerable.)
Public Extension MethodMax<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Int64>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Int64 value. (Defined by Enumerable.)
Public Extension MethodMax<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Int64>>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Int64 value. (Defined by Enumerable.)
Public Extension MethodMax<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Single>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Single value. (Defined by Enumerable.)
Public Extension MethodMax<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Single>>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Single value. (Defined by Enumerable.)
Public Extension MethodMax<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Double>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Double value. (Defined by Enumerable.)
Public Extension MethodMax<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Decimal>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Decimal value. (Defined by Enumerable.)
Public Extension MethodMax<KeyValuePair<String, SemanticValue>, TResult>(Func<KeyValuePair<String, SemanticValue>, TResult>)Overloaded. Invokes a transform function on each element of a generic sequence and returns the maximum resulting value. (Defined by Enumerable.)
Public Extension MethodMin<KeyValuePair<String, SemanticValue>>()Overloaded. Returns the minimum value in a generic sequence. (Defined by Enumerable.)
Public Extension MethodMin<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Decimal>>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value. (Defined by Enumerable.)
Public Extension MethodMin<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Double>>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Double value. (Defined by Enumerable.)
Public Extension MethodMin<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Int32>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Int32 value. (Defined by Enumerable.)
Public Extension MethodMin<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Int32>>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Int32 value. (Defined by Enumerable.)
Public Extension MethodMin<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Int64>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Int64 value. (Defined by Enumerable.)
Public Extension MethodMin<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Int64>>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Int64 value. (Defined by Enumerable.)
Public Extension MethodMin<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Single>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Single value. (Defined by Enumerable.)
Public Extension MethodMin<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Single>>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Single value. (Defined by Enumerable.)
Public Extension MethodMin<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Double>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Double value. (Defined by Enumerable.)
Public Extension MethodMin<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Decimal>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Decimal value. (Defined by Enumerable.)
Public Extension MethodMin<KeyValuePair<String, SemanticValue>, TResult>(Func<KeyValuePair<String, SemanticValue>, TResult>)Overloaded. Invokes a transform function on each element of a generic sequence and returns the minimum resulting value. (Defined by Enumerable.)
Public Extension MethodOfType<TResult>Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Public Extension MethodOrderBy<KeyValuePair<String, SemanticValue>, TKey>(Func<KeyValuePair<String, SemanticValue>, TKey>)Overloaded. Sorts the elements of a sequence in ascending order according to a key. (Defined by Enumerable.)
Public Extension MethodOrderBy<KeyValuePair<String, SemanticValue>, TKey>(Func<KeyValuePair<String, SemanticValue>, TKey>, IComparer<TKey>)Overloaded. Sorts the elements of a sequence in ascending order by using a specified comparer. (Defined by Enumerable.)
Public Extension MethodOrderByDescending<KeyValuePair<String, SemanticValue>, TKey>(Func<KeyValuePair<String, SemanticValue>, TKey>)Overloaded. Sorts the elements of a sequence in descending order according to a key. (Defined by Enumerable.)
Public Extension MethodOrderByDescending<KeyValuePair<String, SemanticValue>, TKey>(Func<KeyValuePair<String, SemanticValue>, TKey>, IComparer<TKey>)Overloaded. Sorts the elements of a sequence in descending order by using a specified comparer. (Defined by Enumerable.)
Public Extension MethodReverse<KeyValuePair<String, SemanticValue>>Inverts the order of the elements in a sequence. (Defined by Enumerable.)
Public Extension MethodSelect<KeyValuePair<String, SemanticValue>, TResult>(Func<KeyValuePair<String, SemanticValue>, TResult>)Overloaded. Projects each element of a sequence into a new form. (Defined by Enumerable.)
Public Extension MethodSelect<KeyValuePair<String, SemanticValue>, TResult>(Func<KeyValuePair<String, SemanticValue>, Int32, TResult>)Overloaded. Projects each element of a sequence into a new form by incorporating the element's index. (Defined by Enumerable.)
Public Extension MethodSelectMany<KeyValuePair<String, SemanticValue>, TResult>(Func<KeyValuePair<String, SemanticValue>, IEnumerable<TResult>>)Overloaded. Projects each element of a sequence to an IEnumerable<T> and flattens the resulting sequences into one sequence. (Defined by Enumerable.)
Public Extension MethodSelectMany<KeyValuePair<String, SemanticValue>, TResult>(Func<KeyValuePair<String, SemanticValue>, Int32, IEnumerable<TResult>>)Overloaded. Projects each element of a sequence to an IEnumerable<T>, and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element. (Defined by Enumerable.)
Public Extension MethodSelectMany<KeyValuePair<String, SemanticValue>, TCollection, TResult>(Func<KeyValuePair<String, SemanticValue>, Int32, IEnumerable<TCollection>>, Func<KeyValuePair<String, SemanticValue>, TCollection, TResult>)Overloaded. Projects each element of a sequence to an IEnumerable<T>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. The index of each source element is used in the intermediate projected form of that element. (Defined by Enumerable.)
Public Extension MethodSelectMany<KeyValuePair<String, SemanticValue>, TCollection, TResult>(Func<KeyValuePair<String, SemanticValue>, IEnumerable<TCollection>>, Func<KeyValuePair<String, SemanticValue>, TCollection, TResult>)Overloaded. Projects each element of a sequence to an IEnumerable<T>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. (Defined by Enumerable.)
Public Extension MethodSequenceEqual<KeyValuePair<String, SemanticValue>>(IEnumerable<KeyValuePair<String, SemanticValue>>)Overloaded. Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type. (Defined by Enumerable.)
Public Extension MethodSequenceEqual<KeyValuePair<String, SemanticValue>>(IEnumerable<KeyValuePair<String, SemanticValue>>, IEqualityComparer<KeyValuePair<String, SemanticValue>>)Overloaded. Determines whether two sequences are equal by comparing their elements by using a specified IEqualityComparer<T>. (Defined by Enumerable.)
Public Extension MethodSingle<KeyValuePair<String, SemanticValue>>()Overloaded. Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence. (Defined by Enumerable.)
Public Extension MethodSingle<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Boolean>)Overloaded. Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists. (Defined by Enumerable.)
Public Extension MethodSingleOrDefault<KeyValuePair<String, SemanticValue>>()Overloaded. Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence. (Defined by Enumerable.)
Public Extension MethodSingleOrDefault<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Boolean>)Overloaded. Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Defined by Enumerable.)
Public Extension MethodSkip<KeyValuePair<String, SemanticValue>>Bypasses a specified number of elements in a sequence and then returns the remaining elements. (Defined by Enumerable.)
Public Extension MethodSkipWhile<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Boolean>)Overloaded. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. (Defined by Enumerable.)
Public Extension MethodSkipWhile<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Int32, Boolean>)Overloaded. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function. (Defined by Enumerable.)
Public Extension MethodSum<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Decimal>>)Overloaded. Computes the sum of the sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Double>>)Overloaded. Computes the sum of the sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Int32>)Overloaded. Computes the sum of the sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Int32>>)Overloaded. Computes the sum of the sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Int64>)Overloaded. Computes the sum of the sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Int64>>)Overloaded. Computes the sum of the sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Single>)Overloaded. Computes the sum of the sequence of Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Nullable<Single>>)Overloaded. Computes the sum of the sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Double>)Overloaded. Computes the sum of the sequence of Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Decimal>)Overloaded. Computes the sum of the sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodTake<KeyValuePair<String, SemanticValue>>Returns a specified number of contiguous elements from the start of a sequence. (Defined by Enumerable.)
Public Extension MethodTakeWhile<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Boolean>)Overloaded. Returns elements from a sequence as long as a specified condition is true. (Defined by Enumerable.)
Public Extension MethodTakeWhile<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Int32, Boolean>)Overloaded. Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function. (Defined by Enumerable.)
Public Extension MethodToArray<KeyValuePair<String, SemanticValue>>Creates an array from a IEnumerable<T>. (Defined by Enumerable.)
Public Extension MethodToDictionary<KeyValuePair<String, SemanticValue>, TKey>(Func<KeyValuePair<String, SemanticValue>, TKey>)Overloaded. Creates a Dictionary<TKey, TValue> from an IEnumerable<T> according to a specified key selector function. (Defined by Enumerable.)
Public Extension MethodToDictionary<KeyValuePair<String, SemanticValue>, TKey>(Func<KeyValuePair<String, SemanticValue>, TKey>, IEqualityComparer<TKey>)Overloaded. Creates a Dictionary<TKey, TValue> from an IEnumerable<T> according to a specified key selector function and key comparer. (Defined by Enumerable.)
Public Extension MethodToDictionary<KeyValuePair<String, SemanticValue>, TKey, TElement>(Func<KeyValuePair<String, SemanticValue>, TKey>, Func<KeyValuePair<String, SemanticValue>, TElement>)Overloaded. Creates a Dictionary<TKey, TValue> from an IEnumerable<T> according to specified key selector and element selector functions. (Defined by Enumerable.)
Public Extension MethodToDictionary<KeyValuePair<String, SemanticValue>, TKey, TElement>(Func<KeyValuePair<String, SemanticValue>, TKey>, Func<KeyValuePair<String, SemanticValue>, TElement>, IEqualityComparer<TKey>)Overloaded. Creates a Dictionary<TKey, TValue> from an IEnumerable<T> according to a specified key selector function, a comparer, and an element selector function. (Defined by Enumerable.)
Public Extension MethodToList<KeyValuePair<String, SemanticValue>>Creates a List<T> from an IEnumerable<T>. (Defined by Enumerable.)
Public Extension MethodToLookup<KeyValuePair<String, SemanticValue>, TKey>(Func<KeyValuePair<String, SemanticValue>, TKey>)Overloaded. Creates a Lookup<TKey, TElement> from an IEnumerable<T> according to a specified key selector function. (Defined by Enumerable.)
Public Extension MethodToLookup<KeyValuePair<String, SemanticValue>, TKey>(Func<KeyValuePair<String, SemanticValue>, TKey>, IEqualityComparer<TKey>)Overloaded. Creates a Lookup<TKey, TElement> from an IEnumerable<T> according to a specified key selector function and key comparer. (Defined by Enumerable.)
Public Extension MethodToLookup<KeyValuePair<String, SemanticValue>, TKey, TElement>(Func<KeyValuePair<String, SemanticValue>, TKey>, Func<KeyValuePair<String, SemanticValue>, TElement>)Overloaded. Creates a Lookup<TKey, TElement> from an IEnumerable<T> according to specified key selector and element selector functions. (Defined by Enumerable.)
Public Extension MethodToLookup<KeyValuePair<String, SemanticValue>, TKey, TElement>(Func<KeyValuePair<String, SemanticValue>, TKey>, Func<KeyValuePair<String, SemanticValue>, TElement>, IEqualityComparer<TKey>)Overloaded. Creates a Lookup<TKey, TElement> from an IEnumerable<T> according to a specified key selector function, a comparer and an element selector function. (Defined by Enumerable.)
Public Extension MethodUnion<KeyValuePair<String, SemanticValue>>(IEnumerable<KeyValuePair<String, SemanticValue>>)Overloaded. Produces the set union of two sequences by using the default equality comparer. (Defined by Enumerable.)
Public Extension MethodUnion<KeyValuePair<String, SemanticValue>>(IEnumerable<KeyValuePair<String, SemanticValue>>, IEqualityComparer<KeyValuePair<String, SemanticValue>>)Overloaded. Produces the set union of two sequences by using a specified IEqualityComparer<T>. (Defined by Enumerable.)
Public Extension MethodWhere<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Boolean>)Overloaded. Filters a sequence of values based on a predicate. (Defined by Enumerable.)
Public Extension MethodWhere<KeyValuePair<String, SemanticValue>>(Func<KeyValuePair<String, SemanticValue>, Int32, Boolean>)Overloaded. Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function. (Defined by Enumerable.)
Public Extension MethodZip<KeyValuePair<String, SemanticValue>, TSecond, TResult>Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results. (Defined by Enumerable.)
Top

  NameDescription
Explicit interface implemetationPrivate methodICollection<KeyValuePair<String, SemanticValue>>.AddAdds the specified key and SemanticValue to the collection.
Explicit interface implemetationPrivate methodICollection<KeyValuePair<String, SemanticValue>>.ClearRemoves all key/value pairs from the collection.
Explicit interface implemetationPrivate methodICollection<KeyValuePair<String, SemanticValue>>.CopyToCopies a key/value pair to a specific location in a targeted array.
Explicit interface implemetationPrivate propertyICollection<KeyValuePair<String, SemanticValue>>.IsReadOnlyGets a value that indicates whether the collection is read-only.
Explicit interface implemetationPrivate methodICollection<KeyValuePair<String, SemanticValue>>.RemoveRemoves the specified key and SemanticValue from the collection.
Explicit interface implemetationPrivate methodIDictionary<String, SemanticValue>.AddAdds the specified key and SemanticValue to the dictionary.
Explicit interface implemetationPrivate propertyIDictionary<String, SemanticValue>.KeysGets a collection that contains the keys from a dictionary of key/value pairs.
Explicit interface implemetationPrivate methodIDictionary<String, SemanticValue>.RemoveRemoves the specified key and SemanticValue from the dictionary.
Explicit interface implemetationPrivate methodIDictionary<String, SemanticValue>.TryGetValueGets the SemanticValue associated with the specified key.
Explicit interface implemetationPrivate propertyIDictionary<String, SemanticValue>.ValuesGets a collection that contains the values from a dictionary of key/value pairs.
Explicit interface implemetationPrivate methodIEnumerable<KeyValuePair<String, SemanticValue>>.GetEnumeratorReturns an enumerator that iterates through a collection.
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorReturns an enumerator that iterates through a collection.
Top

SemanticValue is the primary object that implements the semantic technology in System.Speech. Semantic interpretation allows grammars to define rules for use by a recognition engine to correctly interpret audio input. Semantic interpretation also enables recognition engines to organize their results so that they can be more easily processed, rather than returning only recognized words and sequences of words.

For example, the recognition engine output "Change background to red" would have to be parsed and interpreted by an application before it could be acted upon. A Grammar object can specify a semantic interpretation to make processing clearer by specifying that the phrase has two semantic substructures, one for selecting background or foreground (represented by the text "background"), and the other for selecting color (represented by the text "red").

System.Speech represents the semantics of a recognition operation in a tree of SemanticValue objects.

Each SemanticValue instance includes the following:

  • An Object, accessed by means of the Value property, used to key the instance of the SemanticValue.

  • A measure of the accuracy of semantic parsing, returned by the Confidence property.

  • A collection of name/value pairs ([T:System.Collections.Generic.KeyValuePair(TKey,TValue)]) of child objects, which are also SemanticValue instances. Child nodes are accessible through the SemanticValue implementation of [T:System.Collection.Generic.IDictionaryIDictionary(TKey,TValue)] using a string lookup key and a SemanticValue instance, as in the following example.

    foreach (KeyValuePair<String, SemanticValue> child in semantics) 
    {
      Utils.CreateSemanticsTreeNodes(semanticsNode.Nodes, child.Value, child.Key);
    }
    

Recognition engines based on System.Speech provide valid instances of SemanticValue for all output from recognition, even for phrases with no explicit semantic structure.

The SemanticValue instance for a phrase is obtained using the Semantics property on the RecognizedPhrase object (or objects that inherit from it, such as RecognitionResult).

SemanticValue objects obtained for recognized phrases without semantic structure are characterized by:

  • The lack of children (Count is 0).

  • The Value property is null.

  • An artificial semantic confidence level of 1.0 (returned by Confidence).

Typically, applications create SemanticValue instances indirectly, adding them to Grammar objects by using SemanticResultValue and SemanticResultKey instances, in conjunction with Choices and GrammarBuilder objects.

Direct construction of a SemanticValue instance is useful during the creation of strongly-typed grammars.

SemanticValue implements the [T:System.Collection.Generic.IDictionary(TKey,TValue)], [T:System.Collections.Generic.ICollection(T)], and [T:System.Collections.Generic.IEnumerable(T)] interfaces.

The following example shows a handler for a SpeechRecognized event designed to handle commands to change foreground and background color.

The handler identifies recognized phrases that have no underlying semantic structure by detecting a Count of zero and a Value of null. This recognition output is then processed directly by parsing the raw text.

In other cases, the handler uses keys to obtain the RGB components of a color name, to determine whether the command will change the foreground or background, or to indicate that no valid key was found.


newGrammar.SpeechRecognized +=
  delegate(object sender, SpeechRecognizedEventArgs eventArgs) 
  {

    // Retrieve the value of the semantic property.
    bool changeBackGround = true;
    string errorString = "";
    SemanticValue semantics = eventArgs.Result.Semantics;

    Color newColor = Color.Empty;
    
    try 
    {
      if (semantics.Count == 0 && semantics.Value==null)
      {
        // Signifies recognition by a grammar with no semantics.
        // Parse the string, assuming that the last word is color,
        // and search for “background” or “foreground” in the input.
        if (eventArgs.Result.Text.Contains("foreground")) 
        {
          changeBackGround = false;
        }
        string cName = eventArgs.Result.Words[eventArgs.Result.Words.Count - 1].Text;
        newColor = Color.FromName(cName);
        
      }
      else if (semantics.ContainsKey("colorStringList") ^ semantics.ContainsKey("colorRGBValueList")) 
      {

        // Determine whether to change background or foreground.
        if (semantics.ContainsKey("applyChgToBackground")) 
        {
          changeBackGround = semantics["applyChgToBackground"].Value is bool;
        }

        // Get the RGB color value.
        if (semantics.ContainsKey("colorStringList")) 
        {
          newColor = Color.FromName((string)semantics["colorStringList"].Value);
        }
        if (semantics.ContainsKey("colorRGBValueList")) 
        {
          newColor = System.Drawing.Color.FromArgb((int)semantics["colorRGBValueList"].Value);
        }
      }
      else 
      {

        // Throw an exception if the semantics do not contain the keys we
        // support.
        throw(new Exception("Unsupported semantics keys found."));
      }
    }

    catch (Exception exp) 
    {
      MessageBox.Show(String.Format("Unable to process color semantics.:\n{0}\n", exp.Message));
      return;
    }

    // Change colors, either foreground or background.
    if (changeBackGround) 
    {
      BackColor = newColor;
      float Bright = BackColor.GetBrightness();
      float Hue = BackColor.GetHue();
      float Sat = BackColor.GetSaturation();
      
      // Make sure that text is readable regardless of the background.
      if (BackColor.GetBrightness() <= .50) 
      {
        ForeColor = Color.White;
      }
      else 
      {
        ForeColor = Color.Black;
      }
    }
    else 
    {
      ForeColor = newColor;
      float Bright = ForeColor.GetBrightness();
      float Hue = ForeColor.GetHue();
      float Sat = ForeColor.GetSaturation();

      // Make sure that text is readable regardless of Foreground.
      if (ForeColor.GetBrightness() <= .50) 
      {
        BackColor = Color.White;
      }
      else 
      {
        BackColor = Color.Black;
      }
    }
    return;
  };

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft