rand_moji: Create a random Japanese (Kanji or Hiragana) string

View source: R/rand_moji.R

rand_mojiR Documentation

Create a random Japanese (Kanji or Hiragana) string

Description

Function to create a random Japanese (Kanji or Hiragana) string.

Usage

rand_moji(length, size, replace = TRUE, moji = c("kanji", "hiragana"))

Arguments

length

a positive number, the length of the output string.

size

a positive number, the number of strings to output.

replace

should sampling be with replacement?

moji

Select the string to output. Select Kanji or Hiragana.

Details

It is a random string, so it does not reflect the normal rules of Japanese. In the case of hiragana, characters that do not normally appear at the beginning of a string, such as Sutegana and "n", will also appear at the beginning.

Only the range of regular kanji is supported.

Value

a vector.

Examples

rand_moji(length = 3, size = 3, moji = "kanji")
rand_moji(length = 3, size = 3, moji = "hiragana")

indenkun/infun documentation built on April 17, 2025, 2:52 p.m.