spell

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

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