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

#205 in Internationalization (i18n)

Download history 66/week @ 2024-04-08 90/week @ 2024-04-15 88/week @ 2024-04-22 38/week @ 2024-04-29 48/week @ 2024-05-06 43/week @ 2024-05-13 55/week @ 2024-05-20 30/week @ 2024-05-27 69/week @ 2024-06-03 66/week @ 2024-06-10 58/week @ 2024-06-17 79/week @ 2024-06-24 86/week @ 2024-07-01 138/week @ 2024-07-08 121/week @ 2024-07-15 209/week @ 2024-07-22

555 downloads per month
Used in 2 crates

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