Package: tidycjk 0.2.0

tidycjk: Tidy Tools for Chinese, Japanese and Korean Text

A tidy toolkit for text that is written in Chinese, Japanese or Korean. Most text tooling in R assumes that words are separated by whitespace, which CJK writing does not use, so ordinary summaries of a text column either treat a sentence as one undifferentiated blob or split it into isolated characters. Word segmentation is a pluggable engine, with dictionary-based segmentation for Chinese and Japanese supplied through 'ICU' and further engines registrable by the caller, because where a word ends is a fact about a language and not about Unicode. 'tidycjk' classifies characters by Unicode block, reports which script and which language a text is written in, measures how much of a text is CJK, and turns those measurements into tibbles that slot straight into a 'tidyverse' workflow. It also measures display width in terminal columns, pads, truncates and wraps to a width rather than to a character count, and normalises fullwidth and halfwidth forms surgically -- including composing halfwidth katakana voiced marks into single code points -- while offering the Unicode normalisation forms separately for when a full 'NFKC' fold is what is wanted. Romanisation, conversion between simplified and traditional Han, conversion between the two kana syllabaries, and decomposition of Hangul syllables into jamo are provided on the same vectorised contract. Sentence segmentation, character n-grams, punctuation removal by Unicode category and locale-aware ordering cover the preprocessing that generic tooling gets wrong on CJK, where the sentence terminators are ideographic, a code point sort is not an alphabetical one, and the POSIX punctuation class is resolved by the C library rather than by Unicode. Language detection deliberately returns NA rather than guessing when a text is written in Han characters only, because Japanese written without kana cannot be distinguished from Chinese by script alone. Everything is derived from the Unicode specification; the package makes no network requests and needs no compiled code of its own.

Authors:Youzhi Yu [aut, cre]

tidycjk_0.2.0.tar.gz
tidycjk_0.2.0.zip(r-4.7-any)tidycjk_0.2.0.zip(r-4.6-any)tidycjk_0.2.0.zip(r-4.5-any)
tidycjk_0.2.0.tgz(r-4.6-any)tidycjk_0.2.0.tgz(r-4.5-any)
tidycjk_0.2.0.tar.gz(r-4.7-any)tidycjk_0.2.0.tar.gz(r-4.6-any)
tidycjk_0.2.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
tidycjk/json (API)

# Install 'tidycjk' in R:
install.packages('tidycjk', repos = c('https://pursuitofdatascience.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/pursuitofdatascience/tidycjk/issues

Pkgdown/docs site:https://pursuitofdatascience.github.io

On CRAN:

Conda:

5.08 score 10 scripts 297 downloads 30 exports 16 dependencies

Last updated from:6adddca5cb. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK131
source / vignettesOK223
linux-releaseOK106
macos-releaseOK116
macos-oldrelOK98
windows-develOK100
windows-releaseOK97
windows-oldrelOK90
wasm-releaseOK113

Exports:cjk_blockscjk_char_countscjk_compose_jamocjk_detect_languagecjk_jamocjk_ngramscjk_normalizecjk_ordercjk_padcjk_ratiocjk_romanizecjk_scriptcjk_segmentcjk_segmenterscjk_sentencescjk_simplifycjk_sortcjk_strip_punctcjk_summarycjk_tokenscjk_traditionalizecjk_truncatecjk_widthcjk_wraphas_cjkregister_cjk_segmenterto_fullwidthto_halfwidthto_hiraganato_katakana

Dependencies:clidplyrgenericsgluelifecyclemagrittrpillarpkgconfigR6rlangstringitibbletidyselectutf8vctrswithr

Introduction to tidycjk
Overview | Two layers, one contract | Detection, and the value of refusing to guess | Segmentation | Sentences and n-grams | Sorting | Width, and why your tables are ragged | Normalisation and transliteration | What tidycjk is built on | References

Last update: 2026-10-05
Started: 2026-09-10

Romanisation, script conversion and kana
Four conversions, four different levels of trust | Hangul jamo: exact | Kana: safe, with two things to know | Simplified and traditional Han: right on characters, blind to vocabulary | Romanisation: depends entirely on the language | Width forms are a separate concern | Normalisation is the fourth axis | References

Last update: 2026-10-05
Started: 2026-09-10

Segmenting CJK text
The problem | Choosing an engine | "icu": dictionary-based, and already installed | "character": the honest baseline | Why there is no default | locale does not pick the dictionary | In a pipeline | Registering another engine | gibasa, for Japanese | jiebaR, for Chinese | A caution about argument matching | Comparing engines | References

Last update: 2026-10-05
Started: 2026-09-10

Width, padding, truncation and wrapping
One character is not one column | cjk_pad() | cjk_truncate() | cjk_wrap() | Why this is not "split every N columns" | One rule that is not universal | Indents | The shared contract | Ambiguous width | References

Last update: 2026-10-05
Started: 2026-09-10