问题
Facebook just re-launched Comments, with a automatic grammar fixing feature.
What does the grammar filter do?
- Adds punctuation (e.g. periods at the end of sentences)
- Trims extra whitespace Auto cases words (e.g. capitalize the first word of a sentence)
- Expands slang words (e.g. plz becomes please)
- Adds a space after punctuation (e.g. Hi,Cat would become Hi, Cat)
- Fix common grammar mistakes (e.g. convert ‘dont' to ‘don’t’)
What is an equivalent plugin or gem?
回答1:
I don't know of anything with those particular features.
However, you might look at Ruby LinkParser, which is a Ruby wrapper for the Link Grammar parser developed by academics and used by the Abiword project for grammar checking. (Note that "link" in Link Grammer parser doesn't refer to HTML links, but rather to a structure that describes English syntax as a set of links between words).
Here's another interesting checker, written in Ruby, which is designed to check LaTex files for some of the problems you mention (plus others).
回答2:
"After the Deadline" is a complete (free) grammar checking service. Someone has already written a Ruby wrapper for it.
https://github.com/msepcot/after_the_deadline
回答3:
You may be interested in Gingerice which seems to do what you are looking for!
来源:https://stackoverflow.com/questions/5237791/whats-a-rails-plugin-or-ruby-gem-to-automatically-fix-english-grammar