CheckGrammarOptions

CheckGrammarOptions class

Allows to specify various options while checking grammar of a document using AI.

public class CheckGrammarOptions

Constructors

NameDescription
CheckGrammarOptions()The default constructor.

Properties

NameDescription
ImproveStylistics { get; set; }Allows to specify either AI will try to improve stylistics of the text being proofed. Default value is false.
MakeRevisions { get; set; }Allows to specify either final or revised document to be returned with proofed text. Default value is false.
PreserveFormatting { get; set; }Allows to specify either CheckGrammar will try to preserve layout and formatting of the original document, or not. Default value is true.

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