generated from explainers-by-googlers/template
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathindex.bs
More file actions
114 lines (92 loc) · 3.67 KB
/
index.bs
File metadata and controls
114 lines (92 loc) · 3.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<pre class='metadata'>
Title: Proofreader API
Shortname: proofreader
Level: None
Status: CG-DRAFT
Group: webml
Repository: webmachinelearning/proofreader-api
URL: https://webmachinelearning.github.io/proofreader-api
Editor: Qianqia (Queenie) Zhang, Google https://google.com, queeniezhang@google.com
Editor: Reilly Grant 83788, Google https://www.google.com, reillyg@google.com
Abstract: The proofreader API provides high-level interfaces to call on browser or operating system's built-in language model to help with proofreading tasks.
Markup Shorthands: markdown yes, css no
Complain About: accidental-2119 yes, missing-example-ids yes
Assume Explicit For: yes
Die On: warning
</pre>
<pre class="anchors">
urlPrefix: https://tc39.es/ecma402/; spec: ECMA-402
type: dfn; text: [[AvailableLocales]]; url: sec-internal-slots
type: dfn; text: Unicode canonicalized locale identifier; url: sec-language-tags
type: abstract-op; text: LookupMatchingLocaleByBestFit; url: sec-lookupmatchinglocalebybestfit
type: abstract-op; text: IsStructurallyValidLanguageTag; url: sec-isstructurallyvalidlanguagetag
type: abstract-op; text: CanonicalizeUnicodeLocaleId; url: sec-canonicalizeunicodelocaleid
urlPrefix: https://tc39.es/ecma262/; spec: ECMA-262
type: abstract-op; text: floor; url: eqn-floor
type: dfn; text: current realm; url: current-realm
</pre>
<style>
dl.props { display: grid; grid-template-columns: max-content auto; row-gap: 0.25em; column-gap: 1em; }
dl.props > dt { grid-column-start: 1; margin: 0; }
dl.props > dd { grid-column-start: 2; margin: 0; }
p + dl.props { margin-top: -0.5em; }
.enum-table tbody th { white-space: nowrap; }
</style>
<h2 id="intro">Introduction</h2>
For now, see the [explainer](https://github.com/webmachinelearning/proofreader-api/blob/main/README.md).
<h2 id="proofreader-api">The proofreader API</h2>
<xmp class="idl">
[Exposed=Window, SecureContext]
interface Proofreader {
static Promise<Proofreader> create(optional ProofreaderCreateOptions options = {});
static Promise<Availability> availability(optional ProofreaderCreateCoreOptions options = {});
Promise<ProofreadResult> proofread(
DOMString input,
optional ProofreaderProofreadOptions options = {}
);
readonly attribute boolean includeCorrectionTypes;
readonly attribute boolean includeCorrectionExplanations;
readonly attribute FrozenArray<DOMString>? expectedInputLanguages;
readonly attribute DOMString? outputLanguage;
};
dictionary ProofreaderCreateCoreOptions {
boolean includeCorrectionTypes = false;
boolean includeCorrectionExplanations = false;
sequence<DOMString> expectedInputLanguages;
DOMString outputLanguage;
};
dictionary ProofreaderCreateOptions : ProofreaderCreateCoreOptions {
AbortSignal signal;
CreateMonitorCallback monitor;
};
dictionary ProofreaderProofreadOptions {
AbortSignal signal;
};
dictionary ProofreadResult {
DOMString correctedInput;
sequence<ProofreadCorrection> corrections;
};
dictionary ProofreadCorrection {
unsigned long long startIndex;
unsigned long long endIndex;
DOMString correction;
sequence<CorrectionType> type;
DOMString explanation;
};
enum CorrectionType { "spelling", "punctuation", "capitalization", "preposition", "missing-words", "grammar" };
</xmp>
<h2 id="supporting">Shared infrastructure</h2>
<h3 id="shared-apis">Common APIs</h3>
<xmp class="idl">
[Exposed=Window, SecureContext]
interface CreateMonitor : EventTarget {
attribute EventHandler ondownloadprogress;
};
callback CreateMonitorCallback = undefined (CreateMonitor monitor);
enum Availability {
"unavailable",
"downloadable",
"downloading",
"available"
};
</xmp>