go_hangul: github.com/suapapa/go_hangul Index | Files | Directories

package hangul

import "github.com/suapapa/go_hangul"

Package hangul provide handy tools for manipulate korean character:

- Provide shorthands for korean consonants and vowels
- Convert between jamo and compatibility-jamo
- Split a character to it's three elements
- Split multi element
- Stroke count

Index

Package Files

constant.go hangul.go jamo.go stroke.go

Constants

const (
    G   // HANGUL LETTER KIYEOK
    GG  // HANGUL LETTER SSANGKIYEOK
    GS  // HANGUL LETTER KIYEOK-SIOS
    N   // HANGUL LETTER NIEUN
    NJ  // HANGUL LETTER NIEUN-CIEUC
    NH  // HANGUL LETTER NIEUN-HIEUH
    D   // HANGUL LETTER TIKEUT
    DD  // HANGUL LETTER SSANGTIKEUT
    L   // HANGUL LETTER RIEUL
    LG  // HANGUL LETTER RIEUL-KIYEOK
    LM  // HANGUL LETTER RIEUL-MIEUM
    LB  // HANGUL LETTER RIEUL-PIEUP
    LS  // HANGUL LETTER RIEUL-SIOS
    LT  // HANGUL LETTER RIEUL-THIEUTH
    LP  // HANGUL LETTER RIEUL-PHIEUPH
    LH  // HANGUL LETTER RIEUL-HIEUH
    M   // HANGUL LETTER MIEUM
    B   // HANGUL LETTER PIEUP
    BB  // HANGUL LETTER SSANGPIEUP
    BS  // HANGUL LETTER PIEUP-SIOS
    S   // HANGUL LETTER SIOS
    SS  // HANGUL LETTER SSANGSIOS
    ZS  // HANGUL LETTER IEUNG (zero sound)
    J   // HANGUL LETTER CIEUC
    JJ  // HANGUL LETTER SSANGCIEUC
    C   // HANGUL LETTER CHIEUCH
    K   // HANGUL LETTER KHIEUKH
    T   // HANGUL LETTER THIEUTH
    P   // HANGUL LETTER PHIEUPH
    H   // HANGUL LETTER HIEUH
    A   // HANGUL LETTER A
    AE  // HANGUL LETTER AE
    YA  // HANGUL LETTER YA
    YAE // HANGUL LETTER YAE
    EO  // HANGUL LETTER EO
    E   // HANGUL LETTER E
    YEO // HANGUL LETTER YEO
    YE  // HANGUL LETTER YE
    O   // HANGUL LETTER O
    WA  // HANGUL LETTER WA
    WAE // HANGUL LETTER WAE
    OE  // HANGUL LETTER OE
    YO  // HANGUL LETTER YO
    U   // HANGUL LETTER U
    WEO // HANGUL LETTER WEO
    WE  // HANGUL LETTER WE
    WI  // HANGUL LETTER WI
    YU  // HANGUL LETTER YU
    EU  // HANGUL LETTER EU
    YI  // HANGUL LETTER YI
    I   // HANGUL LETTER I
    NG  = ZS
)

Hangul Compatibility Jamo. Range: 3130-318F

const (
    LEAD_BASE   = 0x1100 // HANGUL CHOSEONG KIYEOK
    MEDIAL_BASE = 0x1161 // HANGUL JUNGSEONG A
    TAIL_BASE   = 0x11A8 // HANGUL JONGSEONG KIYEOK
)

Hangul Jamo. Range 1100-11FF

const (
    LEAD_G  // HANGUL CHOSEONG KIYEOK
    LEAD_GG // HANGUL CHOSEONG SSANGKIYEOK
    LEAD_N  // HANGUL CHOSEONG NIEUN
    LEAD_D  // HANGUL CHOSEONG TIKEUT
    LEAD_DD // HANGUL CHOSEONG SSANGTIKEUT
    LEAD_R  // HANGUL CHOSEONG RIEUL
    LEAD_M  // HANGUL CHOSEONG MIEUM
    LEAD_B  // HANGUL CHOSEONG PIEUP
    LEAD_BB // HANGUL CHOSEONG SSANGPIEUP
    LEAD_S  // HANGUL CHOSEONG SIOS
    LEAD_SS // HANGUL CHOSEONG SSANGSIOS
    LEAD_ZS // HANGUL CHOSEONG IEUNG (zero sound)
    LEAD_J  // HANGUL CHOSEONG CIEUC
    LEAD_JJ // HANGUL CHOSEONG SSANGCIEUC
    LEAD_C  // HANGUL CHOSEONG CHIEUCH
    LEAD_K  // HANGUL CHOSEONG KHIEUKH
    LEAD_T  // HANGUL CHOSEONG THIEUTH
    LEAD_P  // HANGUL CHOSEONG PHIEUPH
    LEAD_H  // HANGUL CHOSEONG HIEUH
)

Initial consonants 초성

const (
    MEDIAL_A   // HANGUL JUNGSEONG A
    MEDIAL_AE  // HANGUL JUNGSEONG AE
    MEDIAL_YA  // HANGUL JUNGSEONG YA
    MEDIAL_YAE // HANGUL JUNGSEONG YAE
    MEDIAL_EO  // HANGUL JUNGSEONG EO
    MEDIAL_E   // HANGUL JUNGSEONG E
    MEDIAL_YEO // HANGUL JUNGSEONG YEO
    MEDIAL_YE  // HANGUL JUNGSEONG YE
    MEDIAL_O   // HANGUL JUNGSEONG O
    MEDIAL_WA  // HANGUL JUNGSEONG WA
    MEDIAL_WAE // HANGUL JUNGSEONG WAE
    MEDIAL_OE  // HANGUL JUNGSEONG OE
    MEDIAL_YO  // HANGUL JUNGSEONG YO
    MEDIAL_U   // HANGUL JUNGSEONG U
    MEDIAL_WEO // HANGUL JUNGSEONG WEO
    MEDIAL_WE  // HANGUL JUNGSEONG WE
    MEDIAL_WI  // HANGUL JUNGSEONG WI
    MEDIAL_YU  // HANGUL JUNGSEONG YU
    MEDIAL_EU  // HANGUL JUNGSEONG EU
    MEDIAL_YI  // HANGUL JUNGSEONG YI
    MEDIAL_I   // HANGUL JUNGSEONG I
)

Medial vowels 중성

const (
    TAIL_G  // HANGUL JONGSEONG KIYEOK
    TAIL_GG // HANGUL JONGSEONG SSANGKIYEOK
    TAIL_GS // HANGUL JONGSEONG KIYEOK-SIOS
    TAIL_N  // HANGUL JONGSEONG NIEUN
    TAIL_NJ // HANGUL JONGSEONG NIEUN-CIEUC
    TAIL_NH // HANGUL JONGSEONG NIEUN-HIEUH
    TAIL_D  // HANGUL JONGSEONG TIKEUT
    TAIL_L  // HANGUL JONGSEONG RIEUL
    TAIL_LG // HANGUL JONGSEONG RIEUL-KIYEOK
    TAIL_LM // HANGUL JONGSEONG RIEUL-MIEUM
    TAIL_LB // HANGUL JONGSEONG RIEUL-PIEUP
    TAIL_LS // HANGUL JONGSEONG RIEUL-SIOS
    TAIL_LT // HANGUL JONGSEONG RIEUL-THIEUTH
    TAIL_LP // HANGUL JONGSEONG RIEUL-PHIEUPH
    TAIL_LH // HANGUL JONGSEONG RIEUL-HIEUH
    TAIL_M  // HANGUL JONGSEONG MIEUM
    TAIL_B  // HANGUL JONGSEONG PIEUP
    TAIL_BS // HANGUL JONGSEONG PIEUP-SIOS
    TAIL_S  // HANGUL JONGSEONG SIOS
    TAIL_SS // HANGUL JONGSEONG SSANGSIOS
    TAIL_NG // HANGUL JONGSEONG IEUNG
    TAIL_J  // HANGUL JONGSEONG CIEUC
    TAIL_C  // HANGUL JONGSEONG CHIEUCH
    TAIL_K  // HANGUL JONGSEONG KHIEUKH
    TAIL_T  // HANGUL JONGSEONG THIEUTH
    TAIL_P  // HANGUL JONGSEONG PHIEUPH
    TAIL_H  // HANGUL JONGSEONG HIEUH
)

Final consonants 종성

const MAX_LEAD_IDX = LEAD_H - LEAD_G
const MAX_MEDIAL_IDX = MEDIAL_I - MEDIAL_A
const MAX_TAIL_IDX = TAIL_H - TAIL_G

func CompatJamo Uses

func CompatJamo(r rune) rune

Convert lead, medial, tail to compatibility jamo

func IsHangul Uses

func IsHangul(r rune) bool

Check Given rune is Hangul

func IsJaeum Uses

func IsJaeum(r rune) bool

Check Given rune is Hangul Jaeum

func IsLead Uses

func IsLead(r rune) bool

Check Given rune is Lead consonant

func IsMedial Uses

func IsMedial(r rune) bool

Check Given rune is Medial vowel

func IsMoeum Uses

func IsMoeum(r rune) bool

Check Given rune is Hangul Moeum

func IsTail Uses

func IsTail(r rune) bool

Check Given rune is Tail consonant

func Join Uses

func Join(l, m, t rune) rune

Convert NFD to NFC

func Lead Uses

func Lead(c rune) rune

Convert compatibility jaeum to corresponding lead consonant

func Medial Uses

func Medial(c rune) rune

Convert compatibility moeum to corresponding medial vowel

func Split Uses

func Split(c rune) (l, m, t rune)

Convert NFC to NFD

func SplitCompat Uses

func SplitCompat(c rune) (l, m, t rune)

Split and got l, m, t in compatibility jamo

func SplitMultiElement Uses

func SplitMultiElement(r rune) ([]rune, bool)

Split multi-element compatibility jamo

func Stroke Uses

func Stroke(r rune) (c int)

Get stroke count of jamo.

func Tail Uses

func Tail(c rune) rune

Convert compatibility jaeum to corresponding tail consonant

Directories

PathSynopsis
encoding/cp949Package cp949 provide support for CP949 character encoding, It's degault encoding in Korean MS Windows.
hanja

Package hangul is imported by 1 packages. Updated 2016-07-18. Refresh now. Tools for package owners.