3

Are there any R functions that receive a sentence/paragraph and return a boolean indicating whether that document is grammatically correct?

i.e.

grammar_check("I've had a good day!") 
# TRUE

grammar_check("ive have a good day") 
# FALSE

I have found some very advanced text capabilities in R (mostly used in machine learning / bag of words etc), for example those in the caret and tm packages, but I have not been able to find any function that can check grammar

Note that this answer points to some python packages and web services, but are for extracting and stemming words, and are not in R

Also note: An informative comment on this answer points out that to write a rules-based function would take a whole team of people a very long time (since English is so idiosyncratic) - so this is not something that can be hacked together by an individual in a short amount of time

stevec
  • 41,291
  • 27
  • 223
  • 311
  • Never used it but maybe this package? https://cran.r-project.org/web/packages/NLP and check out the full list: https://cran.r-project.org/web/views/NaturalLanguageProcessing.html – zx8754 Feb 07 '19 at 07:38

0 Answers0