go-gaga (Japanese language utility)
Installation
For using the library:
Linux:
$ go get github.com/y-bash/go-gaga
Windows:
>go get github.com/y-bash/go-gaga
Next, to install the command (If you use binaries):
Linux:
$ cd $GOPATH/src/github.com/y-bash/go-gaga
$ make install
Windows:
>cd %GOPATH%\src\github.com\y-bash\go-gaga
>go install ./...
Usage
Library
Norm
import "github.com/y-bash/go-gaga"
s := "GaGa is not がガガ"
fmt.Println(s)
n := gaga.Norm(gaga.Fold) // gaga.Fold == gaga.LatinToNarrow | gaga.KanaToWide
fmt.Println(n.String(s))
n.setFlag(gaga.LatinToWide | gaga.AlphaToUpper | gaga.KanaToHiragana)
fmt.Println(n.String(s))
Output:
GaGa is not がガガ
GaGa is not がガガ
GAGA IS NOT ががが
Vert
import "github.com/y-bash/go-gaga"
s := gaga.Vert("閑さや\n岩にしみ入る\n蝉の声")
fmt.Print(s)
Output:
蝉岩閑
のにさ
声しや
み
入
る
Commands
Norm
Linux:
$ echo "ABCアイウ" | norm
ABCアイウ
Windows:
(with wecho comand in the gaga)
>wecho ABCアイウ | norm
ABCアイウ
Vert
Linux:
$ echo -e "閑さや\n岩にしみ入る\n蝉の声" | vert
蝉岩閑
のにさ
声しや
み
入
る
Windows:
(with wecho comand in the gaga)
>wecho 閑さや\n岩にしみ入る\n蝉の声 | vert
蝉岩閑
のにさ
声しや
み
入
る
Norm & Vert
Linux:
$ echo -e "閑さや\n岩にしみ入る\n蝉の声" | norm -flag KanaToWideKatakana | vert
蝉岩閑
ノニサ
声シヤ
ミ
入
ル
Windows:
(with wecho comand in the gaga)
>wecho 閑さや\n岩にしみ入る\n蝉の声 | norm -flag KanaToWideKatakana | vert
蝉岩閑
ノニサ
声シヤ
ミ
入
ル
License
This software is released under the MIT License, see LICENSE.
Author
y-bash