unicode-data-0.2.0: Access Unicode character database
Copyright(c) 2020 Composewell Technologies and Contributors
LicenseApache-2.0
Maintainerstreamly@composewell.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Unicode.Char.Normalization

Description

Low level Unicode database functions to facilitate Unicode normalization.

For more information on Unicode normalization please refer to the following sections of the Unicode standard:

Synopsis

Combining class

isCombining :: Char -> Bool Source #

Returns True if a character is a combining character.

combiningClass :: Char -> Int Source #

Returns the combining class of a character.

isCombiningStarter :: Char -> Bool Source #

Return True if a starter character may combine with some preceding starter character.

Composition

compose :: Char -> Char -> Maybe Char Source #

Compose a starter character (combining class 0) with a combining character (non-zero combining class). Returns the composed character if the starter combines with the combining character, returns Nothing otherwise.

composeStarters :: Char -> Char -> Maybe Char Source #

Compose a starter character with another starter character. Returns the composed character if the two starters combine, returns Nothing otherwise.

Decomposition

Non-Hangul

data DecomposeMode Source #

Whether we are decomposing in canonical or compatibility mode.

Constructors

Canonical 
Kompat 

isDecomposable :: DecomposeMode -> Char -> Bool Source #

Given a non-Hangul character determine if the character is decomposable. Note that in case compatibility decompositions a character may decompose into a single compatibility character.

decompose :: DecomposeMode -> Char -> [Char] Source #

Decompose a non-Hangul character into its canonical or compatibility decompositions. Note that the resulting characters may further decompose.

Hangul

decomposeHangul :: Char -> (Char, Char, Char) Source #

Decompose a Hangul syllable into its corresponding Jamo characters.