Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

websend/rb_spell_checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby Spell Checker

This project is a very simple spell checker based on Peter Norvig's simple spellchecker algorithm (http://norvig.com/spell-correct.html) and uses Brian Adkins' Ruby functions (http://lojic.com/blog/2008/09/04/how-to-write-a-spelling-corrector-in-ruby/). It uses your own word list as a dictionary. This list can be stored in a file or in a database.

How to use

With a input string:

SpellChecker::Checker.new('blue purple yellow green red').check('bluu') => 'blue'

With a dictionary file: dictionary.txt

blue purple yellow green red

ruby

dictionary = File.read('dictionary.txt')
SpellChecker::Checker.new(dictionary).check('bluu') => 'blue'

About

a simple Ruby spelling checker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages