Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2de635f

Browse files
committed
Replace SpeechRecognitionPhraseList with sequence<SpeechRecognitionPhrase>
1 parent 59b1992 commit 2de635f

File tree

1 file changed

+3
-66
lines changed

1 file changed

+3
-66
lines changed

index.bs

Lines changed: 3 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ The term "interim result" indicates a {{SpeechRecognitionResult}} in which the {
163163
<dl dfn-type=attribute dfn-for="SpeechRecognition">
164164
: <dfn>[[phrases]]</dfn>
165165
::
166-
A {{SpeechRecognitionPhraseList}} representing a list of phrases for contextual biasing. The initial value is null.
166+
A sequence of {{SpeechRecognitionPhrase}} representing a list of phrases for contextual biasing. The initial value is an empty sequence.
167167
</dl>
168168

169169
<xmp class="idl">
@@ -178,7 +178,7 @@ interface SpeechRecognition : EventTarget {
178178
attribute boolean interimResults;
179179
attribute unsigned long maxAlternatives;
180180
attribute boolean processLocally;
181-
attribute SpeechRecognitionPhraseList phrases;
181+
attribute sequence<SpeechRecognitionPhrase> phrases;
182182

183183
// methods to drive the speech interaction
184184
undefined start();
@@ -298,16 +298,6 @@ interface SpeechRecognitionPhrase {
298298
readonly attribute DOMString phrase;
299299
readonly attribute float boost;
300300
};
301-
302-
// The object representing a list of phrases for contextual biasing.
303-
[SecureContext, Exposed=Window]
304-
interface SpeechRecognitionPhraseList {
305-
constructor(sequence<SpeechRecognitionPhrase> phrases);
306-
readonly attribute unsigned long length;
307-
SpeechRecognitionPhrase item(unsigned long index);
308-
undefined addItem(SpeechRecognitionPhrase item);
309-
undefined removeItem(unsigned long index);
310-
};
311301
</xmp>
312302

313303
<h4 id="speechreco-attributes">SpeechRecognition Attributes</h4>
@@ -354,7 +344,7 @@ interface SpeechRecognitionPhraseList {
354344
</dd>
355345
<dd>
356346
The setter steps are:
357-
1. If the {{SpeechRecognitionPhraseList/length}} of the given value is greater than 0 and the system does not support contextual biasing,
347+
1. If the size of the given value is greater than 0 and the system does not support contextual biasing,
358348
throw a {{SpeechRecognitionErrorEvent}} with the {{phrases-not-supported}} error code and abort these steps.
359349
1. Set {{SpeechRecognition/[[phrases]]}} to the given value.
360350
1. Send a copy of {{SpeechRecognition/[[phrases]]}} to the system for initializing or updating the phrases for contextual biasing implementation.
@@ -727,59 +717,6 @@ For a non-continuous recognition it will hold only a single value.</p>
727717
<dd>This attribute returns the value of {{[[boost]]}}.</dd>
728718
</dl>
729719

730-
<h4 id="speechreco-phraselist">SpeechRecognitionPhraseList</h4>
731-
732-
<p>The SpeechRecognitionPhraseList object holds a list of phrases for contextual biasing and has the following internal slot:</p>
733-
734-
<dl dfn-type=attribute dfn-for="SpeechRecognitionPhraseList">
735-
: <dfn>[[phrases]]</dfn>
736-
::
737-
A list of {{SpeechRecognitionPhrase}} representing the phrases to be boosted. The initial value is an empty list.
738-
</dl>
739-
740-
<dl>
741-
<dt><dfn constructor for=SpeechRecognitionPhraseList>SpeechRecognitionPhraseList(|phrases|)</dfn> constructor</dt>
742-
<dd>
743-
When this constructor is invoked, run the following steps:
744-
1. Let |list| be a new object of type {{SpeechRecognitionPhraseList}}.
745-
1. Set |list|.{{SpeechRecognitionPhraseList/[[phrases]]}} to be the value of |phrases|.
746-
1. Return |list|.
747-
</dd>
748-
749-
<dt><dfn attribute for=SpeechRecognitionPhraseList>length</dfn> attribute</dt>
750-
<dd>
751-
This attribute indicates the number of phrases in the list.
752-
When invoked, return the number of items in {{SpeechRecognitionPhraseList/[[phrases]]}}.
753-
</dd>
754-
755-
<dt><dfn method for=SpeechRecognitionPhraseList>item(|index|)</dfn> method</dt>
756-
<dd>
757-
This method gets the {{SpeechRecognitionPhrase}} object at the |index| of the list.
758-
When invoked, run the following steps:
759-
1. If |index| is smaller than 0, or greater than or equal to {{SpeechRecognitionPhraseList/length}},
760-
throw a {{RangeError}} and abort these steps.
761-
1. Return the {{SpeechRecognitionPhrase}} at the |index| of {{SpeechRecognitionPhraseList/[[phrases]]}}.
762-
</dd>
763-
764-
<dt><dfn method for=SpeechRecognitionPhraseList>addItem(|item|)</dfn> method</dt>
765-
<dd>
766-
This method adds the {{SpeechRecognitionPhrase}} object |item| to the list.
767-
When invoked, add |item| to the end of {{SpeechRecognitionPhraseList/[[phrases]]}}.
768-
The list is allowed to have multiple {{SpeechRecognitionPhrase}} objects with the same {{SpeechRecognitionPhrase/[[phrase]]}} value,
769-
and the speech recognition model should use the last {{SpeechRecognitionPhrase/[[boost]]}} value
770-
for this {{SpeechRecognitionPhrase/[[phrase]]}} in the list.
771-
</dd>
772-
773-
<dt><dfn method for=SpeechRecognitionPhraseList>removeItem(|index|)</dfn> method</dt>
774-
<dd>
775-
This method removes the {{SpeechRecognitionPhrase}} object at the |index| of the list.
776-
When invoked, run the following steps:
777-
1. If |index| is smaller than 0, or greater than or equal to {{SpeechRecognitionPhraseList/length}},
778-
throw a {{RangeError}} and abort these steps.
779-
1. Remove the {{SpeechRecognitionPhrase}} object at the |index| of {{SpeechRecognitionPhraseList/[[phrases]]}}.
780-
</dd>
781-
</dl>
782-
783720
<h4 id="speechreco-speechgrammar">SpeechGrammar</h4>
784721

785722
<p>The SpeechGrammar object represents a container for a grammar.</p>

0 commit comments

Comments
 (0)