Learn R Programming

RcppMeCab (version 0.0.1.7)

download_dic: Download and install a MeCab dictionary

Description

Downloads and installs a MeCab system dictionary for the specified language. Japanese and Chinese dictionaries are compiled from source using the built-in mecab-dict-index; Korean dictionaries are downloaded pre-compiled. No system-level MeCab installation is required.

Installing a dictionary does not change the MeCab engine linked into RcppMeCab. Japanese and Chinese dictionaries use standard MeCab. Supported Korean behavior requires the mecab-ko engine selected at package installation.

Usage

download_dic(lang)

Value

Invisible path to the installed dictionary directory.

Arguments

lang

Character scalar. Dictionary code: "ja" for Japanese (IPAdic), "ko" for Korean (mecab-ko-dic), or "zh" for Chinese (mecab-jieba).

Details

Dictionaries are stored in the user data directory (tools::R_user_dir("RcppMeCab", "data")).

Examples

Run this code
if (FALSE) {
download_dic("ja")
download_dic("ko")
download_dic("zh")
pos("some text", lang = "ja")
}

Run the code above in your browser using DataLab