CheckGrammar
Contents
[
Hide
]IAiModelText.CheckGrammar method
Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document.
public Document CheckGrammar(Document sourceDocument, CheckGrammarOptions options = null)
Parameter | Type | Description |
---|---|---|
sourceDocument | Document | The document being checked for grammar. |
options | CheckGrammarOptions | Optional settings to control how grammar will be checked. |
Return Value
A new Document
with checked grammar.
Examples
Shows how to check the grammar of a document.
Document doc = new Document(MyDir + "Big document.docx");
string apiKey = Environment.GetEnvironmentVariable("API_KEY");
// Use OpenAI generative language models.
IAiModelText model = (IAiModelText)AiModel.Create(AiModelType.Gpt4OMini).WithApiKey(apiKey);
CheckGrammarOptions grammarOptions = new CheckGrammarOptions();
grammarOptions.ImproveStylistics = true;
Document proofedDoc = model.CheckGrammar(doc, grammarOptions);
proofedDoc.Save("AI.AiGrammar.docx");
See Also
- class Document
- class CheckGrammarOptions
- interface IAiModelText
- namespace Aspose.Words.AI
- assembly Aspose.Words