Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix readme and test #37

Merged
merged 2 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions R/kiwi_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ kiwi_model_exists_one <- function(size) {
#' @param size model size. default is "all" which is true that all three models must be present.
#' @return \code{logical} model files exists or not.
#' @examples
#' \dontrun{
#' get_model("small")
#' model_exists("small")
#' }
#' @export
model_exists <- function(size = "all") {
kiwi_model_exists(size)
Expand All @@ -83,8 +85,10 @@ kiwi_model_work_one <- function(size) {
#' @param size model size. default is "all" which is true that all three models must be present.
#' @return \code{logical} model work or not.
#' @examples
#' \dontrun{
#' get_model("small")
#' model_works("small")
#' }
#' @export
model_works <- function(size = "all") {
kiwi_model_exists(size)
Expand All @@ -98,7 +102,9 @@ model_works <- function(size = "all") {
#'
#' @source \url{https://github.com/bab2min/Kiwi/releases}
#' @examples
#' \dontrun{
#' get_model("small")
#' }
#' @export
get_model <-
function(size = "base",
Expand Down
5 changes: 5 additions & 0 deletions R/split_into_sents.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
#'
#' @param text target text.
#' @param return_tokens add tokenized resault.
#' @examples
#' \dontrun{
#' split_into_sents("text")
#' split_into_sents("text", return_tokens = TRUE)
#' }
#' @export
split_into_sents <- function(text, return_tokens = FALSE) {
if (init_chk_not())
Expand Down
2 changes: 2 additions & 0 deletions R/tokenize.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
#' @returns list type of result.
#' @export
#' @examples
#' \dontrun{
#' tokenize("Test text.")
#' tokenize("Please use Korean.", Match$ALL_WITH_NORMALIZING)
#' }
#' @name tokenize
NULL

Expand Down
8 changes: 4 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ options(crayon.enabled = NULL)


<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/elbird)](https://CRAN.R-project.org/package=elbird)
[![](https://cranlogs.r-pkg.org/badges/elbird)](https://cran.r-project.org/package=elbird)
<!-- badges: end -->

# [한국어 버전](./README_kr.md)는 [여기](./README_kr.md)에서 확인하세요.
# 한국어 버전은 README_kr.md 파일을 확인하세요.

The `elbird` package is a morpheme analysis package packed with [kiwipiepy](https://github.com/bab2min/kiwipiepy).
It is based on cpp package `kiwi` and that has convenient functions such as faster performance compared to other tokenizers, easy user dictionary addition, unregistered noun extraction (not implemented in `elbird` yet).
Expand Down Expand Up @@ -72,6 +72,7 @@ The `tar` below is the target text for morpheme analysis.

```{r}
suppressMessages(library(dplyr))
install.packages("presidentSpeech", repos = "https://forkonlp.r-universe.dev/")
library(stringr)
library(tidytext)
library(presidentSpeech)
Expand Down Expand Up @@ -103,8 +104,7 @@ In addition, an `analyze` function is provided that uses the output of the `anal
```{r}
library(elbird)
analyze("안녕하세요 kiwi 형태소 분석기의 R wrapper인 elbird를 소개합니다.")
analyze(c("안녕하세요","kiwi 형태소 분석기의 R wrapper인 elbird를 소개합니다."))
analyze(c("안녕하세요","kiwi 형태소 분석기의 R wrapper인 elbird를 소개합니다."), top_n = 2)
analyze(c("안녕하세요. kiwi 형태소 분석기의 R wrapper인 elbird를 소개합니다."), top_n = 1)
```

## tag set
Expand Down
Loading