Skip to content

Text spellcheck/correction based on Redis key-value storage server

Notifications You must be signed in to change notification settings

sosedoff/spellcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

= About

SpellCheck is Ruby library to process word/phrase spelling check based on local dictionary.
Redis used as a dictionary storage and cache purposes. 

= Usage

require 'rubygems'
require 'redis'
require 'spellcheck'

# you can specify a new redis client instance or existing one.
# :db -> specify database index (default => current)
sp = SpellCheck.new(Redis.new, :db => 1)

# setup your dictionary by flushing all existing data
# ONLY ONE TIME CALL!!!
sp.flush
sp.load_source('/path/to/textfile')

# default usage
puts "Corrected word: #{sp.correct('saterday')}" # => 'saturday'
puts "Corrected phrase: #{sp.correct_phrase('tthat wqs awesone')}" # => 'that was awesome'

About

Text spellcheck/correction based on Redis key-value storage server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages