GrammarCheckerContext Class

Wordize.AI.GrammarCheckerContext class. Grammar checker context.

GrammarCheckerContext class

Grammar checker context.

public class GrammarCheckerContext : ProcessorContext

Constructors

NameDescription
GrammarCheckerContext(AiModel)

Properties

NameDescription
CheckGrammarOptions { get; }Set of options used while checking grammar of a document using AI.
FontSettings { get; set; }Allows to specify document font settings.
LayoutOptions { get; }Document layout options used by the processor.
WarningCallback { get; set; }Warning callback used by the processor.

Examples

Shows how to create custom OpenAiModel and perform grammar checking using Fluent API.

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);

GrammarCheckerContext context = new GrammarCheckerContext(model);
context.CheckGrammarOptions.ImproveStylistics = true;

GrammarChecker.Create(context)
    .From(MyDir + "SimpleAI.docx")
    .To(ArtifactsDir + "CheckGrammar.docx")
    .Execute();

See Also