Project

grammarbot

0.0
No commit activity in last 3 years
No release in over 3 years
Gem wrapper for GrammarBot API for detecting grammar and spelling errors
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.14
~> 10.0

Runtime

 Project Readme

Grammarbot

A Ruby API client for GrammrBot API

Installation

Add this line to your application's Gemfile:

gem 'grammarbot'

And then execute:

$ bundle

Or install it yourself as:

$ gem install grammarbot

Usage

Client initialization, api_key, language and base_uri are optional and could be ommited, or defined later

gbot = Grammarbot::Client.new(api_key: 'grammarbot_default_key', language: 'en-US', base_uri: 'http://api.grammarbot.io')

gbot.api_key = 'new_api_key'
gbot.language = 'en-GB'
gbot.base_uri = 'http://pro.grammarbot.io'

Don't want to check the key into source control? Put the key on the GRAMMARBOT_API_KEY environment variable!

Simple example

result = gbot.check("I can't remember how to go their.")

result.language.code # => 'en-US'
result.matches.size # => 1
result.matches.first.message # => "Statistics suggests that 'there' (as in 'Is there an answer?') might be the correct word here, not 'their' (as in 'It’s not their fault.'). Please check."

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/GrammarBot-API/grammarbot-rb.

License

The gem is available as open source under the terms of the MIT License.