I'm working with C# in Visual Studio. I need an object to which I can send a String containing an English sentence. I need the object to have a method that will tell me if my English sentence has any grammar/structure errors.
Think of the spell/grammar checker in MS Word. Any grammar/structure errors will be underlined by a green line. I need to determine if any arbitrary sentence would have a green underline if it were written in MS Word.
If such a thing exists it may look like this:
checkGrammar("Arbitrary sentence"); //returns true/false based on being correct or not.
I have looked for something like this but all my search efforts are dominated by results for a Visual Studio Spell Checker which checks your actual code....not what I need.
Does anyone know if such a thing exists in C#?
Thanks in advance for any help.
You may be able to use Word's Grammar checker grammatically if you can be sure it will be installed on the computer running the program.
Documentation
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application();
return word.CheckGrammar("String to check");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With