go-importer/vendor/github.com/gosimple/unidecode
merdan 9d352458d9 vendor papka bolmasa boljak dal 2022-08-12 14:09:26 +05:00
..
.gitignore vendor papka bolmasa boljak dal 2022-08-12 14:09:26 +05:00
LICENSE vendor papka bolmasa boljak dal 2022-08-12 14:09:26 +05:00
README.md vendor papka bolmasa boljak dal 2022-08-12 14:09:26 +05:00
decode.go vendor papka bolmasa boljak dal 2022-08-12 14:09:26 +05:00
make_table.go vendor papka bolmasa boljak dal 2022-08-12 14:09:26 +05:00
table.go vendor papka bolmasa boljak dal 2022-08-12 14:09:26 +05:00
table.txt vendor papka bolmasa boljak dal 2022-08-12 14:09:26 +05:00
unidecode.go vendor papka bolmasa boljak dal 2022-08-12 14:09:26 +05:00

README.md

unidecode

Go Reference Tests

Unicode transliterator in Golang - Replaces non-ASCII characters with their ASCII approximations.

Fork of https://github.com/rainycape/unidecode

Example

package main

import (
	"fmt"

	"github.com/gosimple/unidecode"
)

func main() {
	decoded := unidecode.Unidecode("Łódź")
	fmt.Println(decoded)
	// Output: Lodz
}

Requests or bugs?

https://github.com/gosimple/unidecode/issues

Installation

go get -u github.com/gosimple/unidecode

Benchmark

go test -run=NONE -bench=. -benchmem -count=6 ./... > old.txt
# make changes
go test -run=NONE -bench=. -benchmem -count=6 ./... > new.txt

go install golang.org/x/perf/cmd/benchstat@latest

benchstat old.txt new.txt

Add new characters

  1. Edit table.txt file.

  2. Rebuild table.go file:

    go run ./make_table.go