Documentation ¶
Overview ¶
Package hunspell provides bindings to the hunspell spelling library.
Index ¶
- func Paths(path, lang string) (aff, dic string, err error)
- type Spell
- func (s *Spell) Add(word string) (ok bool)
- func (s *Spell) AddDict(path string) error
- func (s *Spell) AddWithAffix(word, example string) (ok bool)
- func (s *Spell) Analyze(word string) []string
- func (s *Spell) IsCorrect(word string) bool
- func (s *Spell) Remove(word string) (ok bool)
- func (s *Spell) Stem(word string) []string
- func (s *Spell) Suggest(word string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Spell ¶
type Spell struct {
// contains filtered or unexported fields
}
Spell is a hunspell spelling checker. A Spell is only valid if it is returned by a successful call to NewSpell or NewSpellPaths.
func NewSpell ¶
NewSpell returns a spelling checker initialized with the dictionary specified by the lang key located in the given path. NewSpell called with both parameters empty will return a valid empty spell checker. If lang is empty and path is not, an error is returned. NewSpell checks for the existence of the dictionary files.
func NewSpellPaths ¶
NewSpellPaths returns a spelling checker initialized with the dictionary specified by the affix rule and dictionary files. NewSpellPaths checks for the existence of the each file if the path is not empty.
func (*Spell) AddWithAffix ¶
AddWithAffix adds the provided word to the run-time dictionary including affix information from the dictionary example word.