ルール参照
次の表は、文法ドキュメント内で考えられるさまざまな形式のルール参照をまとめたものです。詳細については、音声認識文法仕様バージョン 1 W3C レコメンデーションの「ルール参照
| 参照タイプ | XML フォーム | サポート |
|---|---|---|
| 2.2.1 |
<ruleref
uri="#rulename"/> |
はい |
| 2.2.2 |
<ruleref
uri="grammarURI#rulename"/> |
なし |
| 2.2.2 |
<ruleref
uri="grammarURI"/> |
なし |
| 2.2.2 |
<ruleref uri="grammarURI#rulename"
type="media-type"/> |
なし |
| 2.2.2 |
<ruleref uri="grammarURI"
type="media-type"/> |
なし |
| 2.2.3 |
|
なし |
メモ
-
文法 URI は外部 URI です。例えば、
http://grammar.example.com/world-cities.grxml。 -
メディアタイプには以下のものがあります。
-
application/srgs+xml -
text/plain
-
例
<rule id="city" scope="public">
<one-of>
<item>Boston</item>
<item>Philadelphia</item>
<item>Fargo</item>
</one-of>
</rule>
<rule id="state" scope="public">
<one-of>
<item>FL</item>
<item>MA</item>
<item>NY</item>
</one-of>
</rule>
<!-- "Boston MA" -> city = Boston, state = MA -->
<rule id="city_state" scope="public">
<ruleref uri="#city"/> <ruleref uri="#state"/>
</rule>