Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Henvald committed May 31, 2022
1 parent 3fee8da commit afdf7c6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
14 changes: 8 additions & 6 deletions transliteration.go
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
13 changes: 7 additions & 6 deletions transliteration_rules.go
Original file line number Diff line number Diff line change
@@ -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{
Expand Down
6 changes: 4 additions & 2 deletions transliteration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit afdf7c6

Please sign in to comment.