GrammarChecker.CheckGrammar
CheckGrammar(string, string, AiModel, CheckGrammarOptions)
Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document.
public static void CheckGrammar(string inputFile, string outputFile, AiModel model,
CheckGrammarOptions options = null)
Parameter | Type | Description |
---|---|---|
inputFile | String | The input file name. |
outputFile | String | The output file name. |
model | AiModel | Specifies the AI model responsible for generating the summary of a document. |
options | CheckGrammarOptions | Set of options used while checking grammar of a document using AI. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
Examples
Shows how to create custom OpenAiModel and perform grammar checking.
string apiUrl = Environment.GetEnvironmentVariable("CUSTOM_OPENAI_URL", EnvironmentVariableTarget.User);
string apiName = Environment.GetEnvironmentVariable("CUSTOM_OPENAI_NAME", EnvironmentVariableTarget.User);
string apiKey = Environment.GetEnvironmentVariable("CUSTOM_OPENAI_KEY", EnvironmentVariableTarget.User);
AiModel model = OpenAiModel.Create(apiUrl, apiName, apiKey);
CheckGrammarOptions options = new CheckGrammarOptions() { MakeRevisions = true };
GrammarChecker.CheckGrammar(MyDir + "SimpleAI.docx", ArtifactsDir + "CheckGrammar.docx", model, options);
See Also
- class AiModel
- class CheckGrammarOptions
- class GrammarChecker
- namespace Wordize.AI
- assembly Wordize
CheckGrammar(string, string, SaveFormat, AiModel, CheckGrammarOptions)
Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document.
public static void CheckGrammar(string inputFile, string outputFile, SaveFormat saveFormat,
AiModel model, CheckGrammarOptions options = null)
Parameter | Type | Description |
---|---|---|
inputFile | String | The input file name. |
outputFile | String | The output file name. |
saveFormat | SaveFormat | The save format. |
model | AiModel | Specifies the AI model responsible for generating the summary of a document. |
options | CheckGrammarOptions | Set of options used while checking grammar of a document using AI. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
See Also
- enum SaveFormat
- class AiModel
- class CheckGrammarOptions
- class GrammarChecker
- namespace Wordize.AI
- assembly Wordize
CheckGrammar(Stream, Stream, SaveFormat, AiModel, CheckGrammarOptions)
Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document.
public static void CheckGrammar(Stream inputStream, Stream outputStream, SaveFormat saveFormat,
AiModel model, CheckGrammarOptions options = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input stream. |
outputStream | Stream | The output stream. |
saveFormat | SaveFormat | The save format. |
model | AiModel | Specifies the AI model responsible for generating the summary of a document. |
options | CheckGrammarOptions | Set of options used while checking grammar of a document using AI. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
See Also
- enum SaveFormat
- class AiModel
- class CheckGrammarOptions
- class GrammarChecker
- namespace Wordize.AI
- assembly Wordize