Documentation ¶
Overview ¶
Package spellcheck provides spellcheck based on Damerau–Levenshtein distance algorithm
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { Threshold int // Score threshold (default: 2) // contains filtered or unexported fields }
Model is spellcheck model struct
func Train ¶
Train trains words by given string slice
Example ¶
name := "Frida" names := []string{"Jakalyn", "Freda", "Micayla", "Knightley", "Shun"} model := Train(names) fmt.Printf("%s → %s\n", name, model.Correct(name))
Output: Frida → Freda
func (*Model) Correct ¶
Correct corrects given value
Example ¶
name := "Frida" names := []string{"Jakalyn", "Freda", "Micayla", "Knightley", "Shun"} model := Train(names) fmt.Printf("%s → %s\n", name, model.Correct(name))
Output: Frida → Freda
Click to show internal directories.
Click to hide internal directories.