Skip to content

KimHyeonwoo/go-hangul

Repository files navigation

go-hangul

Run tests Release Go Reference License: MIT

go-hangul 은 한글 자모 분리 및 조합을 위한 Go 패키지입니다.

Features

  • 한글 자모 분리

  • NFC / NFD 정규화 방식을 모두 지원

Installation

go get github.com/KimHyeonwoo/go-hangul

Usage

package main

import (
	"fmt"

	hangul "github.com/KimHyeonwoo/go-hangul"
)

func main() {
	syllables, _ := hangul.Parse("읽기")

	// 초성, 중성, 종성 분리
	// output: [[ㅇ ㅣ ㄺ] [ㄱ ㅣ]]
	fmt.Printf("%c\n", syllables.Decompose(true, hangul.DefaultDecompose))

	// 초성, 중성, 종성 분리 + 겹자음과 겹모음을 모두 분리
	// output: [[ㅇ ㅣ ㄹ ㄱ] [ㄱ ㅣ]]
	fmt.Printf("%c\n", syllables.Decompose(true, hangul.FullDecompose))
}

Contributing

  • 새로운 기능 추가를 원하신다면 Issue나 PR을 올려주세요.

License

MIT license.

About

A package for Hangul (korean alphabet)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages