normalize

Unicode normalization forms (tr15)


Keywords
unicode, normalization, nfc, nfd, nim, nim-lang, unicode-normalization
License
MIT
Install
nimble install normalize

Documentation

Normalize

Build Status licence

A library for normalizing unicode text. Implements all the Unicode Normalization Form algorithms. Normalization is buffered and takes O(n) time and O(1).

Note: the iterator version takes O(1) space, but the proc takes O(n) space.

Usage

import normalize

echo toNFC("E◌̀")  # @[Rune(0x00C8)]
# È

echo toNFD("È")  # @[Rune(0x0045), Rune(0x0300)]
# E◌̀

# toNFKC and toNFKD are also available

Note: when printing to a terminal, the output may visually trick you. Better try printing the len or the runes

docs

Tests

nimble tests
nimble tests2

LICENSE

MIT