config

package
v0.0.0-...-9cd6d0f Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2017 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// IgnoreUppercase ignores "uppercased" words
	IgnoreUppercase = 1
	// IgnoreDigits ignores words with digits
	IgnoreDigits = 2 << 0
	// IgnoreUrls ignores urls, emails, filenames
	IgnoreUrls = 2 << 1
	// FindRepeatWords highlights repetitions of words, consecutive
	FindRepeatWords = 2 << 2
	// IgnoreLatin ignores latin words
	IgnoreLatin = 2 << 3
	// NoSuggest disables suggestions for incorrect words
	NoSuggest = 2 << 4
	// FlagLatin marks latin words as incorrect
	FlagLatin = 2 << 6
	// ByWords ignores dictionary context
	ByWords = 2 << 7
	// IgnoreCapitalization ignores the incorrect use of UPPERCASE/lowercase letters
	IgnoreCapitalization = 2 << 8
	// IgnoreRomanNumerals ignores roman numerals
	IgnoreRomanNumerals = 2 << 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitmask

type Bitmask int

Bitmask is used for bitmasks

func (*Bitmask) Set

func (b *Bitmask) Set(value string) error

Set implements interface of flag.Value (https://golang.org/pkg/flag/#Value)

func (Bitmask) String

func (b Bitmask) String() string

type Config

type Config struct {
	Lang       string
	Format     string
	Options    Bitmask
	Version    Version
	Dictionary Dictionary
}

Config stores settings

func NewConfig

func NewConfig() *Config

NewConfig creates new configuration with default settings

type Dictionary

type Dictionary struct {
	File  string
	Words []*regexp.Regexp
}

Dictionary implements flag.Value interface and stores regexp patterns of allowed words.

func (*Dictionary) Set

func (d *Dictionary) Set(file string) error

Set reads content of a dictionary and save it into the memory

func (Dictionary) String

func (d Dictionary) String() string

type Version

type Version bool

Version implements flag.Value interface to show the version

func (*Version) IsBoolFlag

func (v *Version) IsBoolFlag() bool

IsBoolFlag defines a boolean flag

func (*Version) Set

func (*Version) Set(string) error

Set shows version on triggering of the flag

func (Version) String

func (Version) String() string

Jump to

Keyboard shortcuts

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