https://github.com/paithiov909/tangela
rJava Interface to atilika/kuromoji
https://github.com/paithiov909/tangela
kuromoji r r-package rjava
Last synced: over 1 year ago
JSON representation
rJava Interface to atilika/kuromoji
- Host: GitHub
- URL: https://github.com/paithiov909/tangela
- Owner: paithiov909
- License: apache-2.0
- Created: 2020-04-29T00:55:55.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-01-26T08:57:45.000Z (over 1 year ago)
- Last Synced: 2025-01-26T09:25:05.585Z (over 1 year ago)
- Topics: kuromoji, r, r-package, rjava
- Language: R
- Homepage: https://paithiov909.github.io/tangela/
- Size: 16.2 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
pkgload::load_all()
```
[](#)
[](https://paithiov909.r-universe.dev)
[](https://github.com/paithiov909/tangela/blob/main/LICENSE)
tangela is an rJava wrapper for atilika/kuromoji (bundled v0.7.7).
[Kuromoji](https://github.com/atilika/kuromoji) is a "self-contained Japanese morphological analyzer" such that tangela only requires Java;
It never has any other dependencies such as MeCab and its dictionaries.
## Usage
### Installation
``` r
remotes::install_github("paithiov909/tangela")
```
### Call tagger
```{r}
res <- tangela::kuromoji(
c("なぜ分かり合えないのか!?",
"なぜ貴様等は他を出し抜こうとするのか!?",
"ところできのこはあんな縦に長かったか!?")
)
str(res)
```
### Prettify Output
```{r}
res <- tangela::prettify(res)
head(res)
```
The output has these columns.
- doc_id: 文番号
- token: 表層形(surface form)
- is_unk: 未知語判定(whether or not the token is unknown word?)
- is_user: ユーザー辞書判定(whether or not the token is user defined word?)
- POS1~POS4: 品詞, 品詞細分類1, 品詞細分類2, 品詞細分類3
- X5StageUse1: 活用型(ex. 五段, 下二段…)
- X5StageUse2: 活用形(ex. 連用形, 基本形…)
- Original: 原形(lemmatised form)
- Yomi1: 読み(readings)
- Yomi2: 発音(pronunciation)
### Pack Output
```{r}
res <- tangela::kuromoji(
c("なぜ分かり合えないのか!?",
"なぜ貴様等は他を出し抜こうとするのか!?",
"ところできのこはあんな縦に長かったか!?",
"とにかく不様、そんな事ではあの小娘には勝てないわ。",
"そう、皆で協力して挑むのだ!",
"えー、まぁ今回はその件で伺いました。")
) |>
tangela::prettify() |>
tangela::pack()
print(res)
```
## License
© 2024 Akiru Kato
Licensed under [the Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). This software includes the works distributed under the Apache License, Version 2.0.
Icons made by [Eucalyp](https://www.flaticon.com/authors/eucalyp) from [www.flaticon.com](https://www.flaticon.com/).
