Skip to main content

Crate mecab_ko_hangul

Crate mecab_ko_hangul 

Source
Expand description

§mecab-ko-hangul

한글 자소(Jamo) 처리를 위한 유틸리티 라이브러리입니다.

§Features

  • 한글 자모 분리/결합
  • 초/중/종성 추출
  • 한글 판별 함수
  • 종성 유무 판별

§Example

use mecab_ko_hangul::{decompose, compose, is_hangul, has_jongseong};

// 자모 분리
let (cho, jung, jong) = decompose('한').unwrap();
assert_eq!(cho, 'ㅎ');
assert_eq!(jung, 'ㅏ');
assert_eq!(jong, Some('ㄴ'));

// 자모 결합
let c = compose('ㅎ', 'ㅏ', Some('ㄴ')).unwrap();
assert_eq!(c, '한');

// 한글 판별
assert!(is_hangul('가'));
assert!(!is_hangul('a'));

// 종성 판별
assert_eq!(has_jongseong('한'), Some(true));
assert_eq!(has_jongseong('하'), Some(false));

Enums§

CharType
문자의 종류를 나타내는 열거형

Functions§

classify_char
문자의 종류를 판별합니다.
compose
초성, 중성, 종성을 결합하여 한글 음절을 만듭니다.
compose_str
자모 문자열을 한글 음절로 결합합니다.
decompose
한글 음절을 초성, 중성, 종성으로 분해합니다.
decompose_str
문자열의 모든 한글 음절을 자모로 분해합니다.
has_jongseong
주어진 한글 음절에 종성이 있는지 확인합니다.
is_choseong
주어진 문자가 초성 자모인지 확인합니다.
is_hangul
주어진 문자가 한글(음절 또는 자모)인지 확인합니다.
is_hangul_syllable
주어진 문자가 한글 음절인지 확인합니다.
is_jamo
주어진 문자가 한글 자모인지 확인합니다.
is_jungseong
주어진 문자가 중성 자모인지 확인합니다.