https://github.com/abicky/runicode
R package to proceed Unicode characters
https://github.com/abicky/runicode
Last synced: about 1 year ago
JSON representation
R package to proceed Unicode characters
- Host: GitHub
- URL: https://github.com/abicky/runicode
- Owner: abicky
- Created: 2011-04-17T12:21:08.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2013-05-28T17:27:02.000Z (about 13 years ago)
- Last Synced: 2025-04-12T06:37:58.306Z (about 1 year ago)
- Language: C++
- Homepage:
- Size: 117 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
RUnicode -- Normalize Unicode characters
========================================
Description
-----------
Normalize Unicode characters of a character vector or factor using ICU library.
Currently, Windows is not supported.
Install
-------
Firstly, install ICU library and make sure that you can execute `icu-config --version`.
#### Mac OS X
$ brew install icu4c
$ brew link icu4c --force
#### Debian
$ sudo aptitude install libicu-dev
#### CentOS
$ sudo yum install libicu-devel
Next, clone the repository and install the package.
$ git clone git@github.com:abicky/RUnicode.git
$ R CMD INSTALL RUnicode
Usage
-----
unormalize(x, form = c("NFKC", "NFC", "NFKD", "NFD"), encoding = "utf8")
See also `?unormalize`
Examples
--------
> x <- c("\uff71\uff72\uff73", "\uff11\uff12\uff13")
> x
[1] "アイウ" "123"
> unormalize(x, "NFKC")
[1] "アイウ" "123"
> ga <- "\u304c"
> ga
[1] "が"
> charToRaw(ga)
[1] e3 81 8c
> charToRaw(unormalize(ga, "NFD"))
[1] e3 81 8b e3 82 99