Learn R Programming

moranajp (version 0.9.7)

combine_words: Combine words after morphological analysis

Description

Combine words after morphological analysis

Usage

combine_words(df, combi, sep = "-")

combi_words(x, combi, sep = "-")

Value

A data.frame with combined words.

Arguments

df

A dataframe including result of morphological analysis.

combi

A string (combi_words()) or string vector (combine_words()) to combine words.

sep

A string of separator of words

x

A pair of string joining with "-"

Examples

Run this code
x <- letters[1:10]
combi <- c("b-c")
combi_words(x, combi)
expected <- c("a", "bc", NA, "d", "e", "f", "g", "h", "i", "j")
testthat::expect_equal(combi_words(x, combi), expected)

df <- unescape_utf(review_chamame) |> head(20)
combi <- unescape_utf(
           c("\\u751f\\u7269-\\u591a\\u69d8", "\\u8fb2\\u5730-\\u306f"       ,
             "\\u8fb2\\u7523-\\u7269"       , "\\u751f\\u7523-\\u3059\\u308b"))
combine_words(df, combi)

Run the code above in your browser using DataLab