What's a Rails plugin, or Ruby gem, to automatically fix English grammar?

时光怂恿深爱的人放手 提交于 2019-12-19 02:58:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!