GrammarChecker Class
Wordize.AI.GrammarChecker class. Provides methods for checking grammar in documents using AI.
GrammarChecker class
Provides methods for checking grammar in documents using AI.
public class GrammarChecker : Processor
Methods
Name | Description |
---|---|
static Create(GrammarCheckerContext) | Creates new instance of the GrammarChecker processor. |
Execute() | Execute the processor action. |
From(Stream, LoadOptions) | Specifies input document for processing. |
From(string, LoadOptions) | Specifies input document for processing. |
To(List<Stream>, SaveFormat) | Specifies output Document streams list. |
To(List<Stream>, SaveOptions) | Specifies output Document streams list. |
To(Stream, SaveFormat) | Specifies output stream for the processor. |
To(Stream, SaveOptions) | Specifies output stream for the processor. |
To(string, SaveFormat) | Specifies output file for the processor. |
To(string, SaveOptions) | Specifies output file for the processor. |
static CheckGrammar(string, string, AiModel, CheckGrammarOptions) | Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document. |
static CheckGrammar(Stream, Stream, SaveFormat, AiModel, CheckGrammarOptions) | Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document. |
static CheckGrammar(string, string, SaveFormat, AiModel, CheckGrammarOptions) | Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document. |
static CheckGrammarToImages(Stream, ImageSaveOptions, AiModel, CheckGrammarOptions) | Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document. |
static CheckGrammarToImages(string, ImageSaveOptions, AiModel, CheckGrammarOptions) | Checks grammar of the provided document. This operation leverages the connected AI model for checking grammar of document. |
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 Processor
- namespace Wordize.AI
- assembly Wordize