#syllable #char #localization

hangul

Utilities to manipulate Hangul Syllables

4 releases

0.1.3 Oct 25, 2019
0.1.2 Oct 25, 2019
0.1.1 Jul 11, 2019
0.1.0 Jul 11, 2019

#2181 in Text processing

Download history 117/week @ 2025-09-20 89/week @ 2025-09-27 30/week @ 2025-10-04 99/week @ 2025-10-11 113/week @ 2025-10-18 241/week @ 2025-10-25 96/week @ 2025-11-01 209/week @ 2025-11-08 183/week @ 2025-11-15 233/week @ 2025-11-22 183/week @ 2025-11-29 246/week @ 2025-12-06 151/week @ 2025-12-13 115/week @ 2025-12-20 38/week @ 2025-12-27 269/week @ 2026-01-03

588 downloads per month
Used in 6 crates (3 directly)

MIT license

18KB
115 lines

Hangul

Utilities to manipulate Hangul Syllables.

crates.io version crates.io license crates.io download

Hangul is a library to manipulate Hangul Syllables in the Rust language.

Overview

Hangul is an extension trait implemented for the primitive type char. Currently it has following methods:

  • Predicate checks whether given char is a Hangul Syllable: is_syllable()
  • Predicate indicates whether the syllable has a jongseong — in other words, closed: is_open(), is_closed()
  • Getters for choseong, jungseong, jongseong, and jamo: choseong(), jungseong(), jongseong(), to_jamo()
  • Iterator iterates over jamos consisting a syllable: jamos()

⚠️ This crate only deals with Compatibility Jamo: If you need Jamo, file a issue in this repository with your context.

Usage

Add hangul as a dependency in your Cargo.toml.

[dependencies]
hangul = "0.1.3"

then import HangulExt trait in your code:

use hangul::HangulExt;

Now you can use methods on char.

use hangul::{HangulExt};

assert_eq!(
  "첫사랑"
    .chars()
    .flat_map(|c| c.jamos().unwrap())
    .collect::<String>(),
  "ㅊㅓㅅㅅㅏㄹㅏㅇ"
);

Documentation

See docs.rs

License

Distributed under the MIT license.

No runtime deps