Excerpt |
---|
Transliterates Asian script characters from one script form to another. The string can be specified as a column reference or a string literal. |
Column reference example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value:transliterate(MyJapaneseSentences,HiraganaToKatakana) as:'Katakana' |
---|
|
transliterate(MyJapaneseSentences,HiraganaToKatakana) |
Output: Returns the values in the myJapaneseSentences
transliterated from Hiragana script form to Katakana script form.
D lang syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | derive type:single value:transliterate(column_string,form_enum) |
---|
|
transliterate(column_string,form_enum) |
Argument | Required? | Data Type | Description |
---|
column_string | Y | string | Name of the column or string literal to be applied to the function |
form_enum | Y | string (enumerated value) | The transliteration form as an enumerated value. Details below. |
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.
Required? | Data Type | Example Value |
---|
Yes | String literal or column reference | myColumn |
Enumerated value to indicate the transliteration to apply to the referenced column:
Info |
---|
NOTE: Each width option can be paired with each form option. Four separate options are supported. |
Enum value | Description |
---|
HiraganaToKatakana | Transliterates Hiragana to Katagana |
KatakanaToHiragana | Transliterates Katagana to Hiragana |
FullwidthToHalfwidth | Transliterates full-width forms to half-width form |
HalfwidthToFullwidth | Transliterates half-width forms to full-width form |
Required? | Data Type | Example Value |
---|
Yes | String (enumerated type) | HiraganaToKatakana |
Example - TRANSLITERATE Function
Source:
English | Japanese_Hiragana |
---|
a | あ |
i | い |
u | う |
e | え |
o | お |
ka | か |
ki | き |
ku | く |
ke | け |
ko | こ |
Transformation:
The following transliterates the above characters into Katakana form:
D trans |
---|
RawWrangle | true |
---|
p03Value | 'Japanese_Katakana' |
---|
Type | step |
---|
WrangleText | derive type: single value: transliterate(Japanese_Hiragana, HiraganaToKatakana) as: 'Japanese_Katakana' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | transliterate(Japanese_Hiragana, HiraganaToKatakana) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
The generated Katakana form is full-width. The following transliterates that column into half-width form:
D trans |
---|
RawWrangle | true |
---|
p03Value | 'Japanese_Katakana_halfwidth' |
---|
Type | step |
---|
WrangleText | derive type: single value: transliterate(Japanese_Katakana, FullwidthToHalfwidth) as: 'Japanese_Katakana_halfwidth' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | transliterate(Japanese_Katakana, FullwidthToHalfwidth) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Results:
English | Japanese_Hiragana | Japanese_Katakana | Japanese_Katakana_halfwidth |
---|
a | あ | ア | ァ |
i | い | イ | ィ |
u | う | ウ | ゥ |
e | え | エ | ェ |
o | お | オ | ォ |
ka | か | カ | カ |
ki | き | キ | キ |
ku | く | ク | ク |
ke | け | ケ | ケ |
ko | こ | コ | コ |