diff --git a/README.md b/README.md index ac51ef0..2035b8b 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,9 @@ func main() { ###### bash ```bash -$ go get "github.com/fre5h/transliteration-go"@v1.1.2 -go: downloading github.com/fre5h/transliteration-go v1.1.2 -go: added github.com/fre5h/transliteration-go v1.1.2 +$ go get "github.com/fre5h/transliteration-go"@v1.1.3 +go: downloading github.com/fre5h/transliteration-go v1.1.3 +go: added github.com/fre5h/transliteration-go v1.1.3 $ go run main.go Слава Україні! transliterated text: Slava Ukraini! diff --git a/transliteration.go b/transliteration.go index 6cf9a7b..b6116de 100644 --- a/transliteration.go +++ b/transliteration.go @@ -1,14 +1,16 @@ -// Transliteration from Ukrainian to Latin. -// -// According to the rules of transliteration, that are described in the resolution -// of the Cabinet of Ministers of Ukraine №55 dated January 27, 2010. -// -// https://zakon.rada.gov.ua/laws/show/55-2010-%D0%BF#Text +/* + Package transliteration provides methods for transliterating text from Ukrainian to Latin. + According to the rules of Ukrainian-to-Latin transliteration, that are described in the resolution + of the Cabinet of Ministers of Ukraine №55 dated January 27, 2010. + + https://zakon.rada.gov.ua/laws/show/55-2010-%D0%BF#Text +*/ package transliteration import "unicode" +// UkrToLat transliterates Ukrainian text into Latin in accordance with established rules func UkrToLat(ukrainianText string) (transliteratedText string) { characters := []rune(ukrainianText) numberOfChars := len(characters) diff --git a/transliteration_rules.go b/transliteration_rules.go index 9668230..b93da21 100644 --- a/transliteration_rules.go +++ b/transliteration_rules.go @@ -1,10 +1,11 @@ -// Transliteration from Ukrainian to Latin. -// -// According to the rules of transliteration, that are described in the resolution -// of the Cabinet of Ministers of Ukraine №55 dated January 27, 2010. -// -// https://zakon.rada.gov.ua/laws/show/55-2010-%D0%BF#Text +/* + Package transliteration provides methods for transliterating text from Ukrainian to Latin. + According to the rules of Ukrainian-to-Latin transliteration, that are described in the resolution + of the Cabinet of Ministers of Ukraine №55 dated January 27, 2010. + + https://zakon.rada.gov.ua/laws/show/55-2010-%D0%BF#Text +*/ package transliteration var ukrToLatRules = map[rune]string{ diff --git a/transliteration_test.go b/transliteration_test.go index 6880840..0c5632c 100644 --- a/transliteration_test.go +++ b/transliteration_test.go @@ -5,9 +5,11 @@ // // https://zakon.rada.gov.ua/laws/show/55-2010-%D0%BF#Text -package transliteration +package transliteration_test import ( + "github.com/fre5h/transliteration-go" + "testing" ) @@ -367,7 +369,7 @@ var testVariants = []struct { func TestUkrToLat(t *testing.T) { for _, data := range testVariants { - if result := UkrToLat(data.ukrainian); result != data.latin { + if result := transliteration.UkrToLat(data.ukrainian); result != data.latin { t.Errorf( "Transliteration of %s\"%s\"%s is incorrect, expected: %s\"%s\"%s, actual: %s\"%s\"%s.", yellow, data.ukrainian, reset,