korean_romanizer_go

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2021 License: GPL-2.0 Imports: 0 Imported by: 2

README

korean-romanizer-go

korean-romanizer-go is a golang module that romanizes Korean text in Hangul into its alphabet equivalent.

It currently follows the Revised Romanization of Korean rule developed by the National Institute of Korean Language, the official romanization system being used in the Republic of Korea.

This repository is a direct port of the original Python transliteration implementation by the core contributor Ilkyu Ju, in the osori/korean-romanizer GitHub repository.

Usage

Installation
Linux
wget https://github.com/srevinsaju/korean-romanizer-go/releases/latest/korean_romanizer_linux
Basic Usage
package main

import (
	k "github.com/srevinsaju/korean-romanizer-go"
	
)

func main() {
	r := k.NewRomanizer("안녕하세요")
	r.Romanize()
	# returns 'annyeonghaseyo'
}
License

This is a GoLang port of the original python module. So respect its license. See LICENSE for more information.

Documentation

Index

Constants

View Source
const NullConsonant = 'ᄋ'
View Source
const UnicodeFinalStartIndex = 0x11a8
View Source
const UnicodeFinalStopIndex = 0x11c3
View Source
const UnicodeInitialOffset = 588
View Source
const UnicodeInitialStartIndex = 4352
View Source
const UnicodeInitialStopIndex = 4371
View Source
const UnicodeMedialOffset = 28
View Source
const UnicodeOffset = 44032

Variables

This section is empty.

Functions

func FinalToInitial

func FinalToInitial(char rune) rune

func GetUnicodeFinal

func GetUnicodeFinal() []rune

func GetUnicodeInitial

func GetUnicodeInitial() []rune

func IndexRune

func IndexRune(array []rune, char rune) int

func IsHangul

func IsHangul(char rune) bool

func SeparateSyllable

func SeparateSyllable(char rune) (bool, int, int, int)

Types

type Pronouncer

type Pronouncer struct {
	// contains filtered or unexported fields
}

func NewPronouncer

func NewPronouncer(text string) *Pronouncer

func (*Pronouncer) FinalSubstitute

func (p *Pronouncer) FinalSubstitute() []*Syllable

type Romanizer

type Romanizer struct {
	// contains filtered or unexported fields
}

func NewRomanizer

func NewRomanizer(text string) Romanizer

func (*Romanizer) Romanize

func (r *Romanizer) Romanize() string

type Syllable

type Syllable struct {
	// contains filtered or unexported fields
}

func NewSyllable

func NewSyllable(char rune) *Syllable

func (*Syllable) ConstructSyllable

func (s *Syllable) ConstructSyllable(initial rune, medial rune, final rune) rune

func (*Syllable) ToString

func (s *Syllable) ToString() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL