Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
检查文档中的语法对于确保清晰度,专业性和准确性非常重要。 写得好的文件给人留下积极的印象,避免误解. 语法检查有助于快速识别和纠正错误,节省时间并提高质量。
Aspose.Words允许用户使用AiModelType枚举中列出的OpenAI,Google和Claude模型系列检查语法并检测文档中的错误。 使用CheckGrammar方法分析文档中的文本并突出显示语法问题。
下面的代码示例演示如何使用Aspose.Words中的GPT-4o mini模型来检查语法:
Document doc = new Document("Big document.docx");
String apiKey = System.getenv("API_KEY");
// Use OpenAI generative language models.
IAiModelText model = (OpenAiModel)AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey);
CheckGrammarOptions grammarOptions = new CheckGrammarOptions();
grammarOptions.setImproveStylistics(true);
Document proofedDoc = model.checkGrammar(doc, grammarOptions);
proofedDoc.save("AI.AiGrammar.docx");
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.