다음을 통해 공유


ISpSREngineSite::GetTransitionProperty (Windows Embedded CE 6.0)

1/6/2010

This method gets a property (also known as a "semantic tag") for a transition in a CFG. Use of properties allows semantic information to be embedded inside a grammar.

By default, the engine does not see transition properties. The engine just recognizes the speech from the words in the grammar. Then SAPI parses and adds property information in a call to ISpSREngineSite::ParseFromTransitions.

If it needs to, the engine can see the property information by calling this method on any transition. If there is a property on the transition, the property name or identifier and value are retrieved in a structure. The engine needs to free the structure after each use by calling CoTaskMemFree.

Before calling this method, the engine might want to find out if a transition has a property attached. It can do this by looking at the fHasProperty member in the SPTRANSITIONENTRY structure associated with the transition of interest.

Syntax

HRESULT GetTransitionProperty(
  SPTRANSITIONID ID,
  SPTRANSITIONPROPERTY** ppCoMemProperty
);

Parameters

  • ID
    [in] Transition identifier.
  • ppCoMemProperty
    [out] Address of a pointer to an SPTRANSITIONPROPERTY structure containing the property information. If the transition does not have a property, this parameter retrieves NULL, and the method returns S_FALSE.

Return Value

The following table shows the possible return values.

Value Description

S_OK

Function completed successfully and transition has a property.

S_FALSE

Function completed successfully but transition does not have a property.

E_INVALIDARG

One or more arguments are invalid.

E_OUTOFMEMORY

Exceeded available memory.

FAILED(hr)

Appropriate error message.

Requirements

Header sapiddk.h, sapiddk.idl
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

ISpSREngineSite
SAPI Interfaces