dict

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package dict provides dictionary to fix typos.

Index

Constants

This section is empty.

Variables

View Source
var GlobalSkipPatterns = []struct {
	Pattern *regexp.Regexp
	Replace string
}{
	{
		Pattern: regexp.MustCompile(`\b(` +
			"git-directories" +
			`|` +
			`e\.g\.?` +
			`|` +
			`i\.e\.?` +
			`)\b`),
		Replace: "...",
	},
	{

		Pattern: regexp.MustCompile(`<[^>]+>`),
		Replace: "<...>",
	},
	{

		Pattern: regexp.MustCompile(`\[[^]]+\]`),
		Replace: "[...]",
	},
	{

		Pattern: regexp.MustCompile(`%[0-9]+\$\.\*[0-9]+\$`),
		Replace: "%.*",
	},
	{

		Pattern: regexp.MustCompile(`%[0-9]+\$`),
		Replace: "%",
	},
}

GlobalSkipPatterns defines words we want to ignore for check globally.

View Source
var KeepWordsPattern = regexp.MustCompile(`(` +
	`\${[a-zA-Z0-9_]+}` +
	`|` +
	`\$[a-zA-Z0-9_]+` +
	`|` +
	`\b[a-zA-Z.]+\.[a-zA-Z]+\b` +
	`|` +
	`\b[a-zA-Z0-9_]+_[a-zA-Z0-9]+\b` +
	`|` +
	`\bgit-[a-z-]+` +
	`|` +
	`\bgit [a-z]+-[a-z-]+` +
	`|` +
	`\b[a-z-]+--[a-z-]+` +
	`|` +

	`--(\[[a-z-]+\])?[a-zA-Z0-9-]+(=[a-zA-Z0-9,<\.>*]+)?` +
	`|` +
	`%%\(.*?\)` +
	`|` +
	`\brefs/[a-zA-Z0-9{}<>_.,/-]*` +
	`)`)

KeepWordsPattern defines words we want to keep for check.

View Source
var SmudgeMaps map[string][]SmudgeMap = make(map[string][]SmudgeMap)

SmudgeMaps defines replacement map locales

Functions

This section is empty.

Types

type SmudgeMap added in v0.6.4

type SmudgeMap struct {
	Pattern interface{}
	Replace string
	// If reverse is true, match and replace msgId instead.
	Reverse bool
}

Jump to

Keyboard shortcuts

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