strj_romanize: Romanize Japanese Hiragana and Katakana

View source: R/strj-japanese.R

strj_romanizeR Documentation

Romanize Japanese Hiragana and Katakana

Description

Romanize Japanese Hiragana and Katakana

Usage

strj_romanize(
  text,
  config = c("wikipedia", "traditional hepburn", "modified hepburn", "kunrei", "nihon")
)

Arguments

text

Character vector. If elements are composed of except but hiragana and katakana letters, those letters are dropped from the return value.

config

Configuration used to romanize. Default is wikipedia.

Details

There are several ways to romanize Japanese. Using this implementation, you can convert hiragana and katakana as 5 different styles; the wikipedia style, the ⁠traditional hepburn⁠ style, the ⁠modified hepburn⁠ style, the kunrei style, and the nihon style.

Note that all of these styles return a slightly different form of stringi::stri_trans_general(text, "Any-latn").

Value

A character vector.

See Also

https://github.com/hakatashi/japanese.js#japaneseromanizetext-config

Examples

strj_romanize(
  paste0(
    "\u3042\u306e\u30a4\u30fc\u30cf\u30c8",
    "\u30fc\u30f4\u30a9\u306e\u3059\u304d",
    "\u3068\u304a\u3063\u305f\u98a8"
  )
)

paithiov909/audubon documentation built on Sept. 28, 2024, 8:47 a.m.