{"id":20226199,"url":"https://github.com/eskriett/spell","last_synced_at":"2025-04-10T17:07:03.589Z","repository":{"id":93164503,"uuid":"172348956","full_name":"eskriett/spell","owner":"eskriett","description":"Spelling correction and string segmentation written in Go","archived":false,"fork":false,"pushed_at":"2024-08-06T19:59:52.000Z","size":52,"stargazers_count":27,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T14:50:28.789Z","etag":null,"topics":["golang","spell-check","spellcheck","spelling","spelling-correction","string-segmentation","symspell","text-segmentation","word-segmentation"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eskriett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-24T14:39:30.000Z","updated_at":"2025-03-22T15:49:22.000Z","dependencies_parsed_at":"2023-06-15T20:00:48.193Z","dependency_job_id":null,"html_url":"https://github.com/eskriett/spell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eskriett%2Fspell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eskriett%2Fspell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eskriett%2Fspell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eskriett%2Fspell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eskriett","download_url":"https://codeload.github.com/eskriett/spell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248260657,"owners_count":21074214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","spell-check","spellcheck","spelling","spelling-correction","string-segmentation","symspell","text-segmentation","word-segmentation"],"created_at":"2024-11-14T07:16:44.159Z","updated_at":"2025-04-10T17:07:03.567Z","avatar_url":"https://github.com/eskriett.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spell\n\n[![GoDoc](https://godoc.org/github.com/eskriett/spell?status.svg)](https://godoc.org/github.com/eskriett/spell)\n[![Go Report Card](https://goreportcard.com/badge/github.com/eskriett/spell)](https://goreportcard.com/report/github.com/eskriett/spell)\n[![Build Status](https://travis-ci.com/eskriett/spell.svg?branch=master)](https://travis-ci.com/eskriett/spell)\n\nA blazing fast spell checker written in Go.\n\n__N.B.__ This library is still in early development and may change.\n\n## Overview\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/eskriett/spell\"\n)\n\nfunc main() {\n\t// Create a new instance of spell\n\ts := spell.New()\n\n\t// Add words to the dictionary. Words require a frequency, but can have\n\t// other arbitrary metadata associated with them\n\ts.AddEntry(spell.Entry{\n\t\tFrequency: 100,\n\t\tWord:      \"two\",\n\t\tWordData: spell.WordData{\n\t\t\t\"type\": \"number\",\n\t\t},\n\t})\n\ts.AddEntry(spell.Entry{\n\t\tFrequency: 1,\n\t\tWord:      \"town\",\n\t\tWordData: spell.WordData{\n\t\t\t\"type\": \"noun\",\n\t\t},\n\t})\n\n\t// Lookup a misspelling, by default the \"best\" suggestion will be returned\n\tsuggestions, _ := s.Lookup(\"twon\")\n\tfmt.Println(suggestions)\n\t// -\u003e [two]\n\n\tsuggestion := suggestions[0]\n\n\t// Get the frequency from the suggestion\n\tfmt.Println(suggestion.Frequency)\n\t// -\u003e 100\n\n\t// Get metadata from the suggestion\n\tfmt.Println(suggestion.WordData[\"type\"])\n\t// -\u003e number\n\n\t// Get multiple suggestions during lookup\n\tsuggestions, _ = s.Lookup(\"twon\", spell.SuggestionLevel(spell.LevelAll))\n\tfmt.Println(suggestions)\n\t// -\u003e [two, town]\n\n\t// Save the dictionary\n\ts.Save(\"dict.spell\")\n\n\t// Load the dictionary\n\ts2, _ := spell.Load(\"dict.spell\")\n\n\tsuggestions, _ = s2.Lookup(\"twon\", spell.SuggestionLevel(spell.LevelAll))\n\tfmt.Println(suggestions)\n\t// -\u003e [two, town]\n\n\t// Spell supports word segmentation\n\ts3 := spell.New()\n\n\ts3.AddEntry(spell.Entry{Frequency: 1, Word: \"the\"})\n\ts3.AddEntry(spell.Entry{Frequency: 1, Word: \"quick\"})\n\ts3.AddEntry(spell.Entry{Frequency: 1, Word: \"brown\"})\n\ts3.AddEntry(spell.Entry{Frequency: 1, Word: \"fox\"})\n\n\tsegmentResult, _ := s3.Segment(\"thequickbrownfox\")\n\tfmt.Println(segmentResult)\n\t// -\u003e the quick brown fox\n\n\t// Spell supports multiple dictionaries\n\ts4 := spell.New()\n\n\ts4.AddEntry(spell.Entry{Word: \"épeler\"}, spell.DictionaryName(\"french\"))\n\tsuggestions, _ = s4.Lookup(\"épeler\", spell.DictionaryOpts(\n\t\tspell.DictionaryName(\"french\"),\n\t))\n\tfmt.Println(suggestions)\n\t// -\u003e [épeler]\n}\n```\n\n## Credits\n\nSpell makes use of a symmetric delete algorithm and is loosely based on the\n[SymSpell](https://github.com/wolfgarbe/SymSpell) implementation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feskriett%2Fspell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feskriett%2Fspell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feskriett%2Fspell/lists"}