Skip to content

Erol/jisho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Climate Score

Jisho 辞書

Jisho is a Ruby wrapper for Hunspell.

Usage

You can check for misspelled words by calling Jisho.check:

require 'jisho'

misspellings = Jisho.check 'Thiis sentence has a misspelled word.'

Jisho.check returns an array of hashes, each containing the misspelled word, the row and column where it is located, and the list of suggestions.

misspellings # => [{:word=>"Thiis", :row=>1, :column=>1, :suggestions=>["Thais", "This", "Thins"]}]

You can also get the unique set of misspelled words:

misspellings.words # => ["Thiis"]

Dependencies

Jisho requires Hunspell and atleast one dictionary. You can install them on Mac OS X via MacPorts:

port install hunspell hunspell-dict-en_US

Or via Homebrew:

brew install hunspell

Debian users can use apt-get:

apt-get install hunspell hunspell-en-us

Installation

Add this line to your application's Gemfile:

gem 'jisho'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jisho

Contributing

  1. Fork it
  2. Create your feature branch ( git checkout -b my-new-feature )
  3. Create tests and make them pass ( rake test )
  4. Commit your changes ( git commit -am 'Added some feature' )
  5. Push to the branch ( git push origin my-new-feature )
  6. Create a new Pull Request

About

Ruby wrapper for Hunspell

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages