You are reading help file online using chmlib.com
|
The CONTEXT tag specifies the normalization of a block of text. This specification defines the SAPI predefined attributes (ID) for the CONTEXT tag. These IDs are strings. SAPI does not perform any parameter validation on the string passed to the engine, hence, the application can specify engine-specific normalization IDs to the engine. Engine-specific strings begin with the engine vendor's name to avoid confusion between engines.
For example:
<CONTEXT ID = "MS_My_Context"> text </CONTEXT>
The exact implementation of some of these values is dependent on the engine used in SAPI 5. In order to force a certain normalization, application developers can choose to normalize the text, or use another SAPI tag or engine-specific ID. Each context tag can contain more than one string.
For example:
<CONTEXT ID = "date_mdy"> 12/21/99 11/21/99 10/21/99 </CONTEXT>
would be normalized to "December twenty first nineteen ninety nine November twenty first nineteen ninety nine October twenty first nineteen ninety nine."
The following predefined context types are covered in this section:
This context specifies that the number passed to the engine is a date. Dates will generally have the format of number [delimiter] number [delimiter] number or number [delimiter] number where the delimiter can be a '.', '/' or '-', and numbers are typically between 01 and 12 for months, 01 and 31 for days. A year is generally a two or four-digit number.
The following are valid string types:
For example:
<context ID = "date_mdy">12/21/99</context>
will be normalized to "December twenty first ninety nine"
or "December twenty first nineteen ninety nine"
<context ID = "date_mdy">12/21/1999</context>
will be normalized to "December twenty first nineteen ninety nine"
For example:
<context ID = "date_dmy">21.12.99</context>
will be normalized to "December twenty first ninety nine"
or "December twenty first nineteen ninety nine"
<context ID = "date_ dmy">21-12-1999</context>
will be normalized to "December twenty first nineteen ninety nine"
For example:
<context ID = "date_ymd">99-12-21</context>
will be normalized to "December twenty first ninety nine"
or "December twenty first nineteen ninety nine"
<context ID = "date_ ymd">1999.12.21</context>
will be normalized to "December twenty first nineteen ninety nine"
For example:
<context ID = "date_ym">99-12</context>
will be normalized to "December ninety nine"
or "December nineteen ninety nine"
<context ID = "date_ ym">1999.12</context>
will be normalized to "December nineteen ninety nine"
For example:
<context ID = "date_my">12/99</context>
will be normalized to "December ninety nine"
or "December nineteen ninety nine"
<context ID = "date_my">12/1999</context>
will be normalized to "December nineteen ninety nine"
For example:
<context ID = "date_dm">21.12</context>
will be normalized to "December twenty first"
For example:
<context ID = "date_md">12/21</context>
will be normalized to "December twenty first"
For example:
<context ID = "date_year">1999</context>
will be normalized to "nineteen ninety nine"
<context ID = "date_year">2001</context>
will be normalized to "Two thousand one"
This context specifies that the number passed to the engine is a time. Times will generally have the format of number [delimiter] number [delimiter] number or number [delimiter] number where the delimiter is ':' or ' ' ' or ' " ' and numbers are typically between 01 and 24 for hours, 01 and 59 for minutes and seconds.
When a zero is present in numbers between 01 and 09, the engine can ignore this, or normalize it as "oh". The engine can place an "and" in the normalized time. The valid string types are:
For example:
<context ID = "time">12:30</context>
will be normalized to "twelve thirty"
<context ID = "time">01:21</context>
is normalized as "one twenty one"
or "oh one twenty one"
<context ID = "time">1'21"</context>
is normalized as "one minute twenty one seconds"
or "one minute and twenty one seconds"
For example:
<context ID = "number_cardinal">3432</context>
will be normalized to "three thousand four hundred thirty two"
<context ID = "number_cardinal">3432</context>
will be normalized to "three thousand four hundred and thirty two"
For example:
<context ID = "number_digit">3432</context>
will be normalized to "three four three two"
For example:
<context ID = "number_fraction">3/15</context>
will be normalized to "three fifteenths" or "three over fifteen"
For example:
<context ID = "number_decimal">423.1243</context>
will be normalized to "four hundred and twenty three point one two four three"
For example:
<context ID = "currency">$34.90</context>
will be normalized to "thirty four dollars and ninety cents"
The text is normalized as a URL. The exact implementation of this is left to the engine developer and may be defined in a future release of SAPI.
For example:
<context ID = "web_url">www.Microsoft.com</context>
will be normalized to "is normalized to "w w w dot Microsoft dot com"
The text is normalized as e-mail. The exact implementation of this is left to the engine developer and may be defined in a future release of SAPI.
For example:
<context ID = "E-mail_Address">someone@microsoft.com</context>
is normalized to "Someone at Microsoft dot com"
For example:
<context ID = "address">One Microsoft Way, Redmond, WA, 98052</context>
will be normalized to "One Microsoft Way Redmond Washington nine eight zero five two"
For example:
<context ID = "address_postal">A2C 4X5</context>
will be normalized to "A 2 C 4 X 5"
You are reading help file online using chmlib.com
|