Documentation ¶
Overview ¶
Package spell is a pure-Go, high-performance spell checker based on Hunspell-compatible dictionaries.
Index ¶
Constants ¶
const ( Prefix affixType = iota Suffix )
specific Affix types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker is a spell-checker based on multiple dictionaries.
func NewChecker ¶
func NewChecker(options ...CheckerOption) (*Checker, error)
NewChecker creates a spell checker from multiple Hunspell-compatible dictionaries.
func (*Checker) AddWordListFile ¶
AddWordListFile reads in a word list file
type CheckerOption ¶
type CheckerOption func(opts *Options)
A CheckerOption is a setting that changes the checker-creation process.
func UsingDictionary ¶
func UsingDictionary(name string) CheckerOption
UsingDictionary loads the given Hunspell-compatible dictionary.
func UsingDictionaryByPath ¶
func UsingDictionaryByPath(dic, aff string) CheckerOption
UsingDictionaryByPath loads the given Hunspell-compatible dictionary using the given local paths.
func WithDefault ¶
func WithDefault(load bool) CheckerOption
WithDefault specifies if Vale's default dictionary should be loaded.
func WithDefaultPath ¶
func WithDefaultPath(path string) CheckerOption
WithDefaultPath specifies a path from which all dictionaries should be loaded.
func WithPath ¶
func WithPath(path string) CheckerOption
WithPath specifies the location of Hunspell-compatible dictionaries.