/
doc.go
38 lines (31 loc) · 898 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
Package gaga implements simple functions to manipulate UTF-8 encoded
Japanese strings.
Here is a simple example, converting the character type and printing
it vertically.
First, import gaga.
import "github.com/y-bash/go-gaga"
Define a normalizer using Norm() with the normalization flag.
This declares a normalizer, that converts Latin characters to
half-width and Hiragana-Katakana characters to full-width.
n, err := gaga.Norm(gaga.LatinToNarrow | gaga.KanaToHiragana)
if err != nil {
log.Fatal(err)
}
After normalizer is defined, call to normalize the string using the
normalization flags.
s := n.String("GaGaはがガガではありません")
fmt.Println(s)
Output is:
GaGaはがががではありません
Using Vert(), make this string vertical.
vs := gaga.Vert(s, 3, 5)
fmt.Print(vs)
Output is:
あが G
りが a
まが G
せで a
んはは
*/
package gaga