Romanizes a String of Hangul Characters
This is the swift library written in swift version 4.0
- fluent API
- fully configurable jamo romanization
- configurable syllable divider
- generate random hangul syllables
- API backwards compatibility
Install it with the Swift Package Manager.
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "YourApp",
products: [
.executable(name: "YourApp", targets: ["YourApp"]),
],
dependencies: [
.Package(url: "https://github.com/creekpld/romanize.git", from: "1.0.0")
],
targets: [
.target(
name: "YourApp",
dependencies: ["Romanize"],
path: "Sources"),
]
)
or
import Romanize
romanize("ěë
íě¸ě") // --> annyeong haseyo
romanize("ěë
íě¸ě", true) // --> an-nyeong ha-se-yo
Romanize()
// set a custom syllable divider
.set(divider: "_")
// customize all jamos and romanization
.set(headJamo: .ă
, romanization: "M")
.romanize("미ěíě§ë§ ě ë ě´ ęˇźě˛ ěŹëě´ ěëěě", true)
// --> Mi_an_ha_ji_Man jeo_neun i geun_cheo sa_ram_i a_ni_ye_yo
Romanize()
// generate 10 random hangul syllables
.genHan(10)
// something like this --> ëŻě 쥎íŚë¨í
쾍늍ěžě
Romanize is available as open source under the terms of the MIT License.