There are relatively few always-true, easy rules that can be programmed. However, the vast majority of errors we would want to catch are contextual. This works well when the problem isn't contextual, ie, a rule that says, anytime someone types teh they actually meant the. Most grammar checkers use rules to identify English writing errors and suggest corrections.