TRANSLITERATE Function

Transliterates Asian script characters from one script form to another. The string can be specified as a column reference or a string literal.

Basic Usage

Column reference example:

derive type:single value:TRANSLITERATE(MyJapaneseSentences,HiraganaToKatakana) as:'Katakana'

Output: Creates a new column Katakana containing the values in the myJapaneseSentences transliterated from Hiragana script form to Katakana script form.

Syntax

derive type:single value:TRANSLITERATE(column_string,form_enum)

ArgumentRequired?Data TypeDescription
column_stringYstringName of the column or string literal to be applied to the function
form_enumYstring (enumerated value)The transliteration form as an enumerated value. Details below.

For more information on syntax standards, see Language Documentation Syntax Notes.

column_string

Name of the column or string constant to be transliterated. String values must be in a supported Japanese script form. See below.

  • Missing string or column values generate missing string results.
  • String constants must be quoted ('Hello, World').
  • Multiple columns and wildcards are not supported.

Usage Notes:

Required?Data TypeExample Value
YesString literal or column referencemyColumn

form_enum

Enumerated value to indicate the transliteration to apply to the referenced column:

NOTE: Each width option can be paired with each form option. Four separate options are supported.

Enum valueDescription
HiraganaToKatakanaTransliterates Hiragana to Katagana
KatakanaToHiraganaTransliterates Katagana to Hiragana
FullwidthToHalfwidthTransliterates full-width forms to half-width form
HalfwidthToFullwidthTransliterates half-width forms to full-width form

Usage Notes:

Required?Data TypeExample Value
YesString (enumerated type)HiraganaToKatakana

Examples

Example - TRANSLITERATE Function

Source:

EnglishJapanese_Hiragana
a
i
u
e
o
ka
ki
ku
ke
ko


Transform:

The following transliterates the above characters into Katakana form:

derive type: single value: TRANSLITERATE(Japanese_Hiragana, HiraganaToKatakana) as: 'Japanese_Katakana'

The generated Katakana form is full-width. The following transliterates that column into half-width form:

derive type: single value: TRANSLITERATE(Japanese_Katakana, FullwidthToHalfwidth) as: 'Japanese_Katakana_halfwidth'


Results:

EnglishJapanese_HiraganaJapanese_KatakanaJapanese_Katakana_halfwidth
a
i
u
e
o
ka
ki
ku
ke
ko

Var denne siden nyttig? Si fra hva du synes:

Send tilbakemelding om ...

Google Cloud Dataprep Documentation
Trenger du hjelp? Gå til brukerstøttesiden vår.