Skip to content

Introduce ProofreaderProofreadOptions #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,14 @@ interface ProofreaderFactory {
static Promise<Proofreader> create(optional ProofreaderCreateOptions options = {});
static Promise<AIAvailability> availability(optional ProofreaderCreateCoreOptions options = {});

Promise<ProofreadResult> proofread(DOMString input);
ReadableStream proofreadStreaming(DOMString input);
Promise<ProofreadResult> proofread(
DOMString input,
optional ProofreaderProofreadOptions options = {}
);
ReadableStream proofreadStreaming(
DOMString input,
optional ProofreaderProofreadOptions options = {}
);

// whether to provide correction types for each correction as part of the proofreading result.
readonly attribute boolean includeCorrectionTypes;
Expand All @@ -265,25 +271,29 @@ dictionary ProofreaderCreateCoreOptions {
boolean includeCorrectionExplanations = false;
DOMString correctionExplanationLanguage;
sequence<DOMString> expectedInputLanguages;
}
};

dictionary ProofreaderCreateOptions : ProofreaderCreateCoreOptions {
AbortSignal signal;
AICreateMonitorCallback monitor;
};

dictionary ProofreaderProofreadOptions {
AbortSignal signal;
};

dictionary ProofreadResult {
DOMString correctedInput;
sequence<ProofreadCorrection> corrections;
}
};

dictionary ProofreadCorrection {
unsigned long long startIndex;
unsigned long long endIndex;
DOMString correction;
CorrectionType type;
DOMString explanation;
}
};

enum CorrectionType {
"spelling",
Expand Down