lib

package
v0.0.0-...-2e5d29b Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ignore

func Ignore(words []string)

Ignore removes a correction rule

WARNING: multiple calls to this will unset the previous calls.
 thats not so good.

func Replace

func Replace(input string) string

Replace takes input string and does spelling corrections on commonly misspelled words.

func ReplaceDebug

func ReplaceDebug(input string) string

ReplaceDebug logs exactly what was matched and replaced for using in debugging

func ReplaceGo

func ReplaceGo(input string, debug bool) string

ReplaceGo is a specialized routine for correcting Golang source files. Currently only checks comments, not identifiers for spelling.

Other items:

  • check strings, but need to ignore
  • import "statements" blocks
  • import ( "blocks" )
  • skip first comment (line 0) if build comment

Types

type Diff

type Diff struct {
	Filename  string
	Line      int
	Original  string
	Corrected string
}

Diff is datastructure showing what changed in a single line

func DiffLines

func DiffLines(filename, input, output string) []Diff

DiffLines produces a grep-like diff between two strings showing filename, linenum and change. It is not meant to be a comprehensive diff.

Jump to

Keyboard shortcuts

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