Documentation ¶
Overview ¶
Package words provides a way to read system word lists
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidWord ¶
func IsValidWord(word string, options *IsValidWordOptions) (bool, error)
IsValidWord takes a word and comparison options and tells you if given word is a valid word according to the local word lists. It returns the validness of the word and any errors encountered.
func NewWordList ¶
func NewWordList(options *NewWordListOptions) ([]string, error)
NewWordList reads the systems word list(s) and returns them. It returns the sorted list of unique system words and any errors encountered.
func NewWordMap ¶
func NewWordMap(options *NewWordMapOptions) (map[string]struct{}, error)
NewWordMap reads the systems word list(s) and returns them. It returns the map of system words and any errors encountered.
Types ¶
type IsValidWordOptions ¶
type IsValidWordOptions struct { // IgnoreCase tells the library if it should deduplicate words that are // are eqivalent with respect to case ("Hello" == "hello"). IgnoreCase bool `default:"false"` // IgnoreDiacritics tells the library if it should deduplicate words that are // are eqivalent with respect to diacritics ("Aö" == "Ao"). IgnoreDiacritics bool `default:"false"` // Language specifies the language of the system and it's word lists. Language language.Tag `default:"language.English"` // contains filtered or unexported fields }
IsValidWordOptions defines the parameters of the IsValidWord function.
type NewWordListOptions ¶
type NewWordListOptions struct { // IgnoreSort defines if the function should sort the list or merge the files of // words in the way the happen to appear. IgnoreSort bool `default:"false"` // contains filtered or unexported fields }
NewWordListOptions configures the way the word list and maps should be contructed.
type NewWordMapOptions ¶
type NewWordMapOptions struct {
// contains filtered or unexported fields
}
NewWordMapOptions configures the way the word list and maps should be contructed.