Skip to content

Commit ab7902b

Browse files
authored
Add Proofreader Class to index.bs.
1 parent d542ce1 commit ab7902b

File tree

1 file changed

+43
-6
lines changed

1 file changed

+43
-6
lines changed

index.bs

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,16 @@ enum CorrectionType { "spelling", "punctuation", "capitalization", "grammar" };
143143
1. Return a new {{Proofreader}} object, created in |realm|, with
144144

145145
<dl class="props">
146-
boolean includeCorrectionTypes = false;
147-
boolean includeCorrectionExplanations = false;
148-
: whether to include correction types
146+
: [=Proofreader/include correction types=]
149147
:: |options|["{{ProofreaderCreateCoreOptions/includeCorrectionTypes}}"] default to false
150148

151-
: Proofreader/whether to include correction explanations
149+
: [=Proofreader/include correction explanations=]
152150
:: |options|["{{ProofreaderCreateCoreOptions/includeCorrectionExplanations}}"] default to false
153151

154-
: expected input languages
152+
: [=Proofreader/expected input languages=]
155153
:: the result of [=creating a frozen array=] given |options|["{{ProofreaderCreateCoreOptions/expectedInputLanguages}}"] if it [=set/is empty|is not empty=]; otherwise null
156154

157-
: correction explanation language
155+
: [=Proofreader/correction explanation language=]
158156
:: |options|["{{ProofreaderCreateCoreOptions/correctionExplanationLanguage}}"] if it [=map/exists=]; otherwise null
159157
</dl>
160158
</div>
@@ -319,6 +317,45 @@ A <dfn>language availabilities double</dfn> is a [=struct=] with the following [
319317
1. Return |availability|.
320318
</div>
321319

320+
<h3 id="the-proofreader-class">The {{Proofreader}} class</h3>
321+
322+
Every {{Proofreader}} has a <dfn for="Proofreader">include correction type</dfn>, a [=boolean=] or default to false, set during creation.
323+
324+
Every {{Proofreader}} has a <dfn for="Proofreader">include correction explanations</dfn>, a [=boolean=] or default to false, set during creation.
325+
326+
Every {{Proofreader}} has an <dfn for="Proofreader">expected input languages</dfn>, a <code>{{FrozenArray}}&lt;{{DOMString}}></code> or null, set during creation.
327+
328+
Every {{Proofreader}} has an <dfn for="Proofreader">correction explanation language</dfn>, a [=string=] or null, set during creation.
329+
330+
<hr>
331+
332+
The <dfn attribute for="Proofreader">includeCorrectionTypes</dfn> getter steps are to return [=this=]'s [=Proofreader/include correction types=].
333+
334+
The <dfn attribute for="Proofreader">type</dfn> getter steps are to return [=this=]'s [=Proofreader/include correction explanations=].
335+
336+
The <dfn attribute for="Proofreader">expectedInputLanguages</dfn> getter steps are to return [=this=]'s [=Proofreader/expected input languages=].
337+
338+
The <dfn attribute for="Proofreader">correctionExplanationLanguage</dfn> getter steps are to return [=this=]'s [=Proofreader/correction explanation language=].
339+
340+
<hr>
341+
342+
<div algorithm>
343+
The <dfn method for="Proofreader">proofread(|input|, |options|)</dfn> method steps are:
344+
345+
1. Let |operation| be an algorithm step which takes arguments |chunkProduced|, |done|, |error|, and |stopProducing|, and [=proofreads=] |input| given [=this=]'s [=Proofreader/include correction types=], [=this=]'s [=Proofreader/include correction explanations=], [=this=]'s [=Proofreader/correction explanation language=], |chunkProduced|, |done|, |error|, and |stopProducing|.
346+
347+
1. Return the result of [=getting an aggregated AI model result=] given [=this=], |options|, and |operation|.
348+
</div>
349+
350+
<div algorithm>
351+
The <dfn method for="Proofreader">measureInputUsage(|input|, |options|)</dfn> method steps are:
352+
353+
1. Let |measureUsage| be an algorithm step which takes argument |stopMeasuring|, and returns the result of [=measuring proofreader input usage=] given |input|, [=this=]'s [=Proofreader/include correction types=], [=this=]'s [=Proofreader/include correction explanationse=], [=this=]'s [=Proofreader/correction explanation language=], and |stopMeasuring|.
354+
355+
1. Return the result of [=measuring AI model input usage=] given [=this=], |options|, and |measureUsage|.
356+
</div>
357+
358+
322359
<h2 id="supporting">Shared infrastructure</h2>
323360

324361
<h3 id="shared-apis">Common APIs</h3>

0 commit comments

Comments
 (0)