knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
pkgload::load_all()

rjavacmecab

GitHub last commit Lifecycle: superseded R-CMD-check Codecov test coverage

rJava Interface to CMeCab

rjavacmecab is an rJava interface to takscape/cmecab-java that is a Java binding for MeCab.

The goal of this package is to provide the simplest way to help use 'MeCab' from R than alternatives (RMeCab and RcppMeCab).

rjavacmecab is yet slower, but it should be easier to use because...

  1. There is no need to build from C/C++ source.
  2. It returns all features of each nodes accessible via cmecab-java.

System Requirements

rjavacmecab requires 'MeCab' (mecab, libmecab-dev and mecab-ipadic-utf8) and JDK. Please note that they are installed and available before you use rjavacmecab.

In case using base R and JDK for 32/64bit under Windows, you need 32/64bit build of libmecab.

Usage

Installation

remotes::install_github("paithiov909/rjavacmecab")

Call Tagger

To make cmecab tagger available, rebuild_tagger at first.

rjavacmecab::rebuild_tagger()

res <- rjavacmecab::cmecab(c("長期的自己実現で福楽は得られない", "幸せは刹那の中にあり"))
str(res)

Prettify Output

res <- rjavacmecab::prettify(res)
str(res)

If you use IPA-styled dictionary, the output has these columns.

Pack Output

res <- rjavacmecab::pack(res)
print(res)

Use Igo

Igo is a pure Java port of MeCab. rjavacmecab also provides a wrapper function of that.

res <- rjavacmecab::igo("お前がそう思うんならそうなんだろう、お前ん中ではな")
str(res)

License

BSD 3-clause License.

This software includes works that are distributed in Public Domain and New BSD License. See https://github.com/takscape/cmecab-java/blob/master/README.txt for more details.

Icons made by Vectors Market from Flaticon.



paithiov909/rjavacmecab documentation built on Feb. 1, 2023, 4 a.m.