Skip to content

Commit 9ada362

Browse files
committed
Fix available() → availability() in the spec
Closes #34.
1 parent 6b66dfd commit 9ada362

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

index.bs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ partial interface AI {
111111
[Exposed=(Window,Worker), SecureContext]
112112
interface AISummarizerFactory {
113113
Promise<AISummarizer> create(optional AISummarizerCreateOptions options = {});
114-
Promise<AICapabilityAvailability> available(optional AISummarizerCreateCoreOptions options = {});
114+
Promise<AICapabilityAvailability> availability(optional AISummarizerCreateCoreOptions options = {});
115115
};
116116

117117
[Exposed=(Window,Worker), SecureContext]
@@ -393,7 +393,7 @@ The <dfn attribute for="AI">summarizer</dfn> getter steps are to return [=this=]
393393
<h3 id="summarizer-availability">Availability</h3>
394394

395395
<div algorithm>
396-
The <dfn method for="AISummarizerFactory">available(|options|)</dfn> method steps are:
396+
The <dfn method for="AISummarizerFactory">availability(|options|)</dfn> method steps are:
397397

398398
1. If [=this=]'s [=relevant global object=] is a {{Window}} whose [=associated Document=] is not [=Document/fully active=], then return [=a promise rejected with=] an "{{InvalidStateError}}" {{DOMException}}.
399399

@@ -569,25 +569,25 @@ All of these [=struct/items=] are [=sets=] of strings representing [=Unicode can
569569

570570
One way this could be implemented would be for [=summarizer language availabilities=] to return that "`zh-Hant`" is in the [=language availabilities/readily available input languages=], and "`zh`" and "`zh-Hans`" are in the [=language availabilities/after-download available input languages=]. This return value conforms to the requirements of the [=language tag set completeness rules=], in ensuring that "`zh`" is present. Per <a class="allow-2119" href="#readily-or-after-download-implementation-defined">the "should"-level guidance</a>, the implementation has determined that "`zh`" belongs in the set of [=language availabilities/after-download available input languages=], with "`zh-Hans`", instead of in the set of [=language availabilities/readily available input languages=], with "`zh-Hant`".
571571

572-
Combined with the use of [$LookupMatchingLocaleByBestFit$], this means {{AISummarizerFactory/available()}} will give the following answers:
572+
Combined with the use of [$LookupMatchingLocaleByBestFit$], this means {{AISummarizerFactory/availability()}} will give the following answers:
573573

574574
<xmp class="language-js">
575-
function inputLangAvailable(languageTag) {
576-
return ai.summarizer.available({
575+
function inputLangAvailability(languageTag) {
576+
return ai.summarizer.availability({
577577
expectedInputLanguages: [languageTag]
578578
});
579579
}
580580

581-
inputLangAvailable("zh") === "after-download";
582-
inputLangAvailable("zh-Hant") === "readily";
583-
inputLangAvailable("zh-Hans") === "after-download";
581+
inputLangAvailability("zh") === "after-download";
582+
inputLangAvailability("zh-Hant") === "readily";
583+
inputLangAvailability("zh-Hans") === "after-download";
584584

585-
inputLangAvailable("zh-TW") === "readily"; // zh-TW will best-fit to zh-Hant
586-
inputLangAvailable("zh-HK") === "readily"; // zh-HK will best-fit to zh-Hant
587-
inputLangAvailable("zh-CN") === "after-download"; // zh-CN will best-fit to zh-Hans
585+
inputLangAvailability("zh-TW") === "readily"; // zh-TW will best-fit to zh-Hant
586+
inputLangAvailability("zh-HK") === "readily"; // zh-HK will best-fit to zh-Hant
587+
inputLangAvailability("zh-CN") === "after-download"; // zh-CN will best-fit to zh-Hans
588588

589-
inputLangAvailable("zh-BR") === "after-download"; // zh-BR will best-fit to zh
590-
inputLangAvailable("zh-Kana") === "after-download"; // zh-Kana will best-fit to zh
589+
inputLangAvailability("zh-BR") === "after-download"; // zh-BR will best-fit to zh
590+
inputLangAvailability("zh-Kana") === "after-download"; // zh-Kana will best-fit to zh
591591
</xmp>
592592
</div>
593593
</div>
@@ -1026,7 +1026,7 @@ Just IDL for now; full spec coming!
10261026
[Exposed=(Window,Worker), SecureContext]
10271027
interface AIWriterFactory {
10281028
Promise<AIWriter> create(optional AIWriterCreateOptions options = {});
1029-
Promise<AICapabilityAvailability> available(optional AIWriterCreateCoreOptions options = {});
1029+
Promise<AICapabilityAvailability> availability(optional AIWriterCreateCoreOptions options = {});
10301030
};
10311031

10321032
[Exposed=(Window,Worker), SecureContext]
@@ -1081,7 +1081,7 @@ Just IDL for now; full spec coming!
10811081
[Exposed=(Window,Worker), SecureContext]
10821082
interface AIRewriterFactory {
10831083
Promise<AIRewriter> create(optional AIRewriterCreateOptions options = {});
1084-
Promise<AICapabilityAvailability> available(optional AIRewriterCreateCoreOptions options = {});
1084+
Promise<AICapabilityAvailability> availability(optional AIRewriterCreateCoreOptions options = {});
10851085
};
10861086

10871087
[Exposed=(Window,Worker), SecureContext]

0 commit comments

Comments
 (0)