Class HangulService

class HangulService

  • transform hangul to qwerty type.

Hierarchy

  • HangulService

Constructors

Properties

CHOSEONG: string[] = ...

1.Initial consonants (초성)

JONGSEONG: string[] = ...
  1. Final consonants (종성)
JUNGSEONG: string[] = ...
  1. Medial vowels (중성)
JamoDecomposeMap: Map<string, string> = ...

Hangul Composite Jamo(겹자모) -> Hangul Basic Jamo(기본 자모)

QwertyMap: Map<string, string> = ...

Hangul Jamo -> Alphabet (in QWERTY 2벌식)

Methods

  • Transform to Alphabet key stroke sequence (for QWERTY/Korean 2-bul) e.g. '한글' -> 'gksrmf'

    Parameters

    • text: string

      input text

    Returns string

  • Decompose the text to Hangul Basic Jamo sequence (for Search-As-You-Type)

    • 다양한 종류의 입력 방식(e.g. 세벌식) 지원을 위해 최소 단위인 기본 자모(24자)로 분해함 e.g. '한글' -> 'ㅎㅏㄴㄱㅡㄹ', '맴찟' -> 'ㅁㅏㅣㅁㅈㅈㅣㅅ'

    Parameters

    • text: string

      input text

    Returns string

  • 초성만을 추출 (Korean only) e.g. 한글 -> ㅎㄱ

    Parameters

    • text: string

      input text

    Returns string

  • Decompose text into Hangul (Compatibility) Jamo sequence

    • 초성, 중성, 종성으로 분해 e.g. '한글' -> 'ㅎㅏㄴㄱㅡㄹ', '맴찟' -> 'ㅁㅐㅁㅉㅣㅅ'

    [Note] 유니코드 한글 자모는 초/중/종성에 서로 다른 코드 영역이 할당되어 있다. 따라서 동일한 자모라도 초성에 위치할 때와 종성에 위치할 때 코드값이 다르다. (예. 초성 'ㄱ': U+1100, 종성 'ㄱ': U+11A8) 이를 Compatibility Jamo로서 같은 코드값을 사용하도록 변형한다. [Reference]

    Parameters

    • text: string

      input text

    Returns string

  • Identify whether given text is Hangul or not

    Parameters

    • text: string

      input text

    • partial: boolean = false

      (optional) if set true, result is true if there is at least one Korean letter in the text (default: false)

    Returns boolean

  • Check the code is Hangul Compatibility Jamo

    Parameters

    • code: number

      character code

    Returns boolean

Generated using TypeDoc