read_cidian: Read a Chinese input-method dictionary

View source: R/cidian.R

read_cidianR Documentation

Read a Chinese input-method dictionary

Description

read_cidian() reads a supported binary dictionary and returns a common cidian_dictionary object. The parser preserves source order and does not normalize, sort, or deduplicate entries.

Usage

read_cidian(path, ..., format = c("scel", "qcel", "qpyd", "bdict", "bcd"))

Arguments

path

A path to a dictionary file.

...

Must be empty.

format

A format name, with or without a leading dot. Supported values are "scel", "qcel", "qpyd", "bdict", and "bcd".

Details

The format is inferred from the file extension when format is omitted or NULL. Supply format when the file has no extension or its extension is wrong.

Value

A cidian_dictionary object containing metadata, entries, and format fields. The entries$code column is a list-column of character vectors, and entries$weight is a numeric vector.

Examples

x <- read_cidian(system.file("extdata", "computer.qcel", package = "cidian"))
x

cidian documentation built on Sept. 28, 2026, 5:08 p.m.