Function Repository Resource:

ToHiragana

Source Notebook

Convert any katakana characters in a string to hiragana

Contributed by: Jan Mangaldan

ResourceFunction["ToHiragana"][string]

yields a string in which all katakana characters have been converted to hiragana.

Details

Hiragana (平仮名, ひらがな) is a Japanese syllabary, one component of the Japanese writing system, along with katakana, kanji and in some cases, rōmaji (Latin script).
ResourceFunction["ToHiragana"] handles both unvoiced and voiced versions of kana characters.
Kanji and Roman letters are left untouched.
ResourceFunction["ToHiragana"] automatically threads over lists.

Examples

Basic Examples (1) 

Convert the first line of the Iroha:

In[1]:=
ResourceFunction["ToHiragana"]["イロハニホヘト"]
Out[1]=

Scope (2) 

Convert a list of katakana strings:

In[2]:=
ResourceFunction["ToHiragana"][{"イロハニホヘト", "チリヌルヲ"}]
Out[2]=

Non-katakana characters are not converted:

In[3]:=
ResourceFunction["ToHiragana"]["色ハ匂エド"]
Out[3]=
In[4]:=
ResourceFunction["ToHiragana"]["頭カラッポの方が 夢詰め込める"]
Out[4]=

Applications (1) 

Generate the hiragana syllabary from the katakana syllabary:

In[5]:=
ResourceFunction["ToHiragana"][Alphabet["Katakana"]]
Out[5]=

Properties and Relations (1) 

The functions ToHiragana and ToKatakana are inverses of each other:

In[6]:=
ResourceFunction["ToHiragana"]["ドングリコロコロ"]
Out[6]=
In[7]:=
ResourceFunction["ToKatakana"][%]
Out[7]=

Requirements

Wolfram Language 12.3 (May 2021) or above

Version History

  • 1.0.0 – 20 March 2024

Related Resources

License Information