spell

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package spell provides spell checking via the hunspell binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallHint

func InstallHint() string

InstallHint returns a platform-specific hint for installing hunspell.

func IsAvailable

func IsAvailable() bool

IsAvailable reports whether hunspell is installed and accessible via PATH.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker wraps hunspell for spell checking.

func New

func New(lang, personalDic string) *Checker

New creates a new Checker with the given language and optional personal dictionary path.

func (*Checker) AddPersonal

func (c *Checker) AddPersonal(word string) error

AddPersonal appends word to the personal dictionary file.

func (*Checker) Check

func (c *Checker) Check(words []string) []string

Check returns the subset of words that are misspelled. Returns nil when words is empty or hunspell fails.

func (*Checker) Suggest

func (c *Checker) Suggest(word string) []string

Suggest returns suggested corrections for a misspelled word. Returns nil if hunspell is unavailable or no suggestions exist.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL