All Projects → eskriett → spell

eskriett / spell

Licence: MIT license
Spelling correction and string segmentation written in Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to spell

Symspell
SymSpell: 1 million times faster spelling correction & fuzzy search through Symmetric Delete spelling correction algorithm
Stars: ✭ 1,976 (+8133.33%)
Mutual labels:  spellcheck, spelling, spell-check, word-segmentation, spelling-correction, text-segmentation, symspell
SymSpellCppPy
Fast SymSpell written in c++ and exposes to python via pybind11
Stars: ✭ 28 (+16.67%)
Mutual labels:  spellcheck, spelling, spell-check, word-segmentation, spelling-correction, text-segmentation, symspell
WordSegmentationDP
Word Segmentation with Dynamic Programming
Stars: ✭ 18 (-25%)
Mutual labels:  spellcheck, spell-check, word-segmentation, spelling-correction, text-segmentation, symspell
spellchecker-wasm
SpellcheckerWasm is an extrememly fast spellchecker for WebAssembly based on SymSpell
Stars: ✭ 46 (+91.67%)
Mutual labels:  spellcheck, spelling, spell-check, spelling-correction, symspell
Did you mean
The gem that has been saving people from typos since 2014
Stars: ✭ 1,786 (+7341.67%)
Mutual labels:  spellcheck, spelling, spell-check, spelling-correction
LinSpell
Fast approximate strings search & spelling correction
Stars: ✭ 52 (+116.67%)
Mutual labels:  spellcheck, spelling, spell-check, spelling-correction
check-spelling
Spelling checker action
Stars: ✭ 139 (+479.17%)
Mutual labels:  spellcheck, spelling, spell-check
Symspellpy
Python port of SymSpell
Stars: ✭ 420 (+1650%)
Mutual labels:  spellcheck, spell-check, word-segmentation
customized-symspell
Java port of SymSpell: 1 million times faster through Symmetric Delete spelling correction algorithm
Stars: ✭ 51 (+112.5%)
Mutual labels:  word-segmentation, spelling-correction, symspell
spacy hunspell
✏️ Hunspell extension for spaCy 2.0.
Stars: ✭ 94 (+291.67%)
Mutual labels:  spelling, spell-check, spelling-correction
yaspeller-ci
Fast spelling check for Travis CI
Stars: ✭ 60 (+150%)
Mutual labels:  spellcheck, spelling
Dspellcheck
Notepad++ Spell-checking Plug-in
Stars: ✭ 144 (+500%)
Mutual labels:  spellcheck, spell-check
contextualSpellCheck
✔️Contextual word checker for better suggestions
Stars: ✭ 274 (+1041.67%)
Mutual labels:  spellcheck, spelling-correction
neuspell
NeuSpell: A Neural Spelling Correction Toolkit
Stars: ✭ 524 (+2083.33%)
Mutual labels:  spellcheck, spelling-correction
ispell-lt
Lithuanian spellchecking dictionary
Stars: ✭ 26 (+8.33%)
Mutual labels:  spellcheck, spelling
cyberdic
An auxiliary spellcheck dictionary that corresponds with the Bishop Fox Cybersecurity Style Guide
Stars: ✭ 63 (+162.5%)
Mutual labels:  spellcheck, spelling
Wecantspell.hunspell
A port of Hunspell v1 for .NET and .NET Standard
Stars: ✭ 61 (+154.17%)
Mutual labels:  spellcheck, spell-check
Symspellcompound
SymSpellCompound: compound aware automatic spelling correction
Stars: ✭ 61 (+154.17%)
Mutual labels:  spellcheck, spell-check
Pylanguagetool
Python Library and CLI for the LanguageTool JSON API
Stars: ✭ 62 (+158.33%)
Mutual labels:  spellcheck, spell-check
Spelling
Tools for Spell Checking in R
Stars: ✭ 82 (+241.67%)
Mutual labels:  spellcheck, spell-check

spell

GoDoc Go Report Card Build Status

A blazing fast spell checker written in Go.

N.B. This library is still in early development and may change.

Overview

package main

import (
	"fmt"

	"github.com/eskriett/spell"
)

func main() {
	// Create a new instance of spell
	s := spell.New()

	// Add words to the dictionary. Words require a frequency, but can have
	// other arbitrary metadata associated with them
	s.AddEntry(spell.Entry{
		Frequency: 100,
		Word:      "two",
		WordData: spell.WordData{
			"type": "number",
		},
	})
	s.AddEntry(spell.Entry{
		Frequency: 1,
		Word:      "town",
		WordData: spell.WordData{
			"type": "noun",
		},
	})

	// Lookup a misspelling, by default the "best" suggestion will be returned
	suggestions, _ := s.Lookup("twon")
	fmt.Println(suggestions)
	// -> [two]

	suggestion := suggestions[0]

	// Get the frequency from the suggestion
	fmt.Println(suggestion.Frequency)
	// -> 100

	// Get metadata from the suggestion
	fmt.Println(suggestion.WordData["type"])
	// -> number

	// Get multiple suggestions during lookup
	suggestions, _ = s.Lookup("twon", spell.SuggestionLevel(spell.LevelAll))
	fmt.Println(suggestions)
	// -> [two, town]

	// Save the dictionary
	s.Save("dict.spell")

	// Load the dictionary
	s2, _ := spell.Load("dict.spell")

	suggestions, _ = s2.Lookup("twon", spell.SuggestionLevel(spell.LevelAll))
	fmt.Println(suggestions)
	// -> [two, town]

	// Spell supports word segmentation
	s3 := spell.New()

	s3.AddEntry(spell.Entry{Frequency: 1, Word: "the"})
	s3.AddEntry(spell.Entry{Frequency: 1, Word: "quick"})
	s3.AddEntry(spell.Entry{Frequency: 1, Word: "brown"})
	s3.AddEntry(spell.Entry{Frequency: 1, Word: "fox"})

	segmentResult, _ := s3.Segment("thequickbrownfox")
	fmt.Println(segmentResult)
	// -> the quick brown fox

	// Spell supports multiple dictionaries
	s4 := spell.New()

	s4.AddEntry(spell.Entry{Word: "épeler"}, spell.DictionaryName("french"))
	suggestions, _ = s4.Lookup("épeler", spell.DictionaryOpts(
		spell.DictionaryName("french"),
	))
	fmt.Println(suggestions)
	// -> [épeler]
}

Credits

Spell makes use of a symmetric delete algorithm and is loosely based on the SymSpell implementation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].