Categorygithub.com/y-bash/go-gaga
modulepackage
0.0.2
Repository: https://github.com/y-bash/go-gaga.git
Documentation: pkg.go.dev

# README

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

# Packages

No description provided by the author
No description provided by the author

# Functions

Norm creates a new Normalizer with specified flag (LatinToNarrow etc.).
ParseNormFlag returns a flags parsed names.
Vert returns the vertical conversion of the in.
VertFix returns the vertical conversion of the in.
VertShrink returns the vertical conversion of the in.

# Constants

AlphaToLower converts all the upper case Latin letters to their lower case.
AlphaToNarrow converts all the full-width Latin letters to their half-width.
AlphaToUpper converts all the lower case Latin letters to their upper case.
AlphaToWide converts all the half-width Latin letters to their full-width.
ComposeVom composes the voiced or semi-voiced sound letters in the most conventional way.
DecomposeVom decomposes the voiced or semi-voiced sound letters in a way similar to the Unicode canonical decomposition mappings.
DigitToNarrow converts all the full-width Latin digits to their half-width.
DigitToWide converts all the half-width Latin digits to their full-width.
Fold is a combination of normalization flags for converting the Latin characters and the Hiragana-Katakana characters to their canonical width.
HiraganaToKatakana converts the full-width Hiragana letters to their full-width Katakana as much as possible.
HiraganaToNarrow converts the full-width Hiragana letters to their half-width Katakana as much as possible.
IsolatedVomToNarrow converts an isolated voicing modifier which was not combined into a base letter into a half-width voiced or semi-voiced sound letter.
IsolatedVomToCombining converts an isolated voicing modifier which was not combined into a base letter into a combining voiced or semi-voiced sound letter.
IsolatedVomToWide converts an isolated voicing modifier which was not combined into a base letter into a full-width voiced or semi-voiced sound letter.
KanaSymbolToNarrow converts the full-width Hiragana-Katakana symbols to their half-width as much as possible.
KanaSymbolToWide converts all the half-width Katakana symbols to their full-width.
KanaToHiragana is a combination of normalization flags for converting the full-width Katakana characters to their Hiragana as much as possible, and all the half-width Katakana characters to their Hiragana.
KanaToNarrow is a combination of normalization flags for converting the full-width Hiragana-Katakana characters to their half-width as much as possible.
KanaToNarrowKatakana is a combination of normalization flags for converting the full-width Katakana characters to their half-width, and the Hiragana characters to their half-width Katakana as much as possible.
KanaToWide is a combination of normalization flags for converting all the half-width Katakana characters to their full-width.
KanaToWideKatakana is a combination of normalization flags for converting all the half-width Katakana characters to their full-width, and the Hiragana characters to their full-width Katakana as much as possible.
KatakanaToHiragana converts the half-width or full-width Katakana letters to their full-width Hiragana as much as possible.
KatakanaToNarrow converts the full-width Katakana letters to their half-width Katakana as much as possible.
KatakanaToWide converts all the half-width Katakana letters to their full-width Katakana.
LatinToNarrow is a combination of normalization flags for converting all the full-width Latin characters to their half-width.
LatinToWide is a combination of normalization flags for converting all the half-width Latin characters to their full-width.
SymbolToNarrow converts all the full-width Latin symbols to their half-width.
SymbolToWide converts all the half-width Latin symbols to their full-width.

# Structs

Normalizer normalizes the input provided and returns the normalized string.

# Type aliases

NormFlag is the normalization rule used by Normalizer.