Skip to content

Hiragana / Katakana transformation with NKF compatibility

License

Notifications You must be signed in to change notification settings

wantedly/kana-go

Repository files navigation

Kana

Go Reference

Module kana provides transformation between:

  • Fullwidth and halfwidth characters
  • Katakana and hiragana

It also provides NKF-compatible wrapper.

Example

package main

import (
	"fmt"

	"github.com/wantedly/kana-go"
)

func main() {
	str := kana.Convert("ABC DEF", kana.FullwidthToNarrow)
	fmt.Println(str) // Output: ABC DEF
}

NKF-compatible example

package main

import (
	"fmt"

	"github.com/wantedly/kana-go/nkf"
)

func main() {
	str, err := nkf.Convert("ABC DEF", "-w -W -m0 -Z1")
	if err != nil {
		panic(err)
	}
	fmt.Println(str) // Output: ABC DEF
}

About

Hiragana / Katakana transformation with NKF compatibility

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages