Handy tools to manipulate korean character.
Switch branches/tags
Clone or download
Permalink
Failed to load latest commit information.
brand add new logo Aug 31, 2018
encoding/cp949 Add license header in doc.go Oct 8, 2015
hanja hanja: add license header May 10, 2013
.gitignore Add travis config May 15, 2013
.travis.yml Add travis config May 15, 2013
LICENSE Initial commit of go pkg, hangul. Jul 19, 2012
README.md add new logo Aug 31, 2018
constant.go add new constants which following go's naming convention Sep 27, 2018
constant_deperecate.go add new constants which following go's naming convention Sep 27, 2018
example_test.go mov examples to example_test.go Aug 20, 2018
go.mod
hangul.go mov examples to example_test.go Aug 20, 2018
hangul_test.go supress warnnings in ide Aug 20, 2018
jamo.go supress warnnings in ide Aug 20, 2018
stroke.go supress warnnings in ide Aug 20, 2018

README.md

hangul logo

About hangul

hangul is a set of handy tools for manipulate korean character in Go language.

GoDoc Build Status

Example

package main

import (
        "fmt"
        hangul "github.com/suapapa/go_hangul"
)

func main() {
        var i, m, f, ci, cm, cf rune
        var c int
        for _, r := range "맥도날드" {
                // Storke count
                c = hangul.Stroke(r)
                // Split to three elements
                i, m, f = hangul.Split(r)
                // Convert between jamo and compatibility-jamo
                ci = hangul.CompatJamo(i)
                cm = hangul.CompatJamo(m)
                cf = hangul.CompatJamo(f)

                fmt.Printf("%c %d %c(%v) %c(%v) %c(%v)\n", r, c, ci, i, cm, m, cf, f)
        }
        fmt.Println("")

        fmt.Println(
            hangul.EndsWithConsonant("강")) // true
        fmt.Println(
            hangul.EndsWithConsonant("그")) // false
        fmt.Println(
            hangul.AppendPostposition("강", "이", "가")) // "강이"
        fmt.Println(
            hangul.AppendPostposition("물고기", "은", "는")) // "물고기는"
}

Installation

$ go get github.com/suapapa/go_hangul

Author

Homin Lee <homin.lee@suapapa.net>

Copyright & License

Copyright (c) 2012, Homin Lee. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.