VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This code can be used in Excel This will create a transcription from the Chinese language To the Du

by Berry van Zanten (1 Submission)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 1st December 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This code can be used in Excel This will create a transcription from the Chinese language To the Dutch language. My some simple adjustment, it

API Declarations


Const ju = "dzjuu-uu"
Const qu = "tsjuu-uu"
Const xu = "sjuu-uu"

Const zi = "dz"
Const ci = "tz"
Const si = "sz"

Const zi_om = "zi- als de 'dz' uitspreken met de tanden op elkaar"
Const ci_om = "ci- als de 'tz' uitspreken met de tanden op elkaar"
Const si_om = "si- als de 'sz' uitspreken met de tanden op elkaar"

Const b_om = "b- als de 'b' in het woord baard"
Const p_om = "p- als de 'p' in paard, maar goed aanblazen en met een duidelijk plofklank"
Const d_om = "d- als de 'd' in vrijdag"
Const t_om = "t- als de 't' van toen, hard aanblazen"
Const g_om = "g- als de 'k' in kaas"
Const k_om = "k- ook als 'k' in kaas, maar aanblazen en met plofklank"
Const h_om = "h- als de 'ch' in lachen, maar helemaal achter in de keel"
Const m_om = "m -als 'm' in meer"
Const n_om = "n -als 'n' in nee"
Const l_om = "l -als 'l' in leeg"
Const f_om = "f -als 'f' in fee"
Const w_om = "w- als de 'w' in wees"
Const y_om = "y- als de 'j' in jaar"
Const s_om = "s- als de 's' in slee"
Const sh_om = "sh- als de 'sj' in sjaal"
Const c_om = "c- als de 'ts' in plaats"
Const ch_om = "ch- als de 'ch' in cha-cha (het snoepje)"
Const z_om = "z -als 't z' in het zinnetje 't zal regenen"
Const zh_om = "zh- als de 'ch' in cha-cha-cha (de dans)"
Const j_om = "j- als de 'j' in jungle"
Const q_om = "q- als de 'tsj' in hatsjie, zoals u niest"
Const x_om = "x- als de 'sj' in de naam Shana"
Const r_om = "r- als de Engelse 'r', zoals in right, dus zonder te rollen"

Const zhi = "zhr"
Const chi = "chr"
Const shi = "shr"
Const ri = "rr"

Const sh = "sj"
Const ch = "ch"
Const zh = "ch"
Const h = "ch"
Const b = "b"
Const p = "p"
Const d = "d"
Const t = "t"
Const g = "k"
Const k = "k"
Const m = "m"
Const n = "n"
Const l = "l"
Const f = "f"
Const w = "w"
Const y = "j"
Const s = "s"
Const c = "ts"
Const z = "'t z"
Const j = "j"
Const q = "tsj"
Const x = "sj"
Const R = "r"


Const end_iang = "ie-a-ang "
Const end_iong = "ie-oe-oeng "
Const end_uang = "oe-a-ang "
Const end_ang = "a-ang "
Const end_eng = "uh-ung "
Const end_ong = "oe-oeng "
Const end_uan = "oe-a-an "
Const end_uai = "oe-a-ai "
Const end_iao = "ie-a-ao "
Const end_ing = "ie-ing "
Const end_ian = "ie-a-en "

Const end_üan = "uu-u-an "

Const end_an = "a-an "
Const end_ai = "a-ai "
Const end_ao = "a-ao "
Const end_en = "uh-un "
Const end_ei = "ee-yi "
Const end_ou = "oo-oe "
Const end_ua = "oe-a-a "
Const end_uo = "oe-oh "
Const end_ui = "oe-ee-ei "
Const end_un = "oe-uh-un "
Const end_ue = "uu-è "

Const end_üe = "uu-è "
Const end_ün = "uu-uun "

Const end_ia = "ie-a-a "
Const end_ie = "ie-e "
Const end_iu = "ie-oo-oe "
Const end_in = "ie-ien "

Const end_ü = "uu-uu "


Const end_a = "a-a "
Const end_o = "o-oh "
Const end_e = "uh-uh "
Const end_u = "oe-oe "
Const end_i = "ie-ie "


Rate This code can be used in Excel This will create a transcription from the Chinese language To the Du



    Dim pinyin As String
    Dim transcriptie As String
    Dim locat As Integer
    Dim uitleg As String
    locat = 1
    pinyin = ActiveCell.Value
    
    
Do
    If locat > Len(pinyin) Then Exit Do
    If Mid(LCase(pinyin), locat, 2) = "! " Then transcriptie = transcriptie + "! * ": locat = locat + 2
    If Mid(LCase(pinyin), locat, 2) = "? " Then transcriptie = transcriptie + "? * ": locat = locat + 2
    If Mid(LCase(pinyin), locat, 2) = ", " Then transcriptie = transcriptie + ", * ": locat = locat + 2
    If Mid(LCase(pinyin), locat, 2) = ". " Then transcriptie = transcriptie + ". * ": locat = locat + 2
    If Mid(LCase(pinyin), locat, 1) = " " Then transcriptie = transcriptie + " * ": locat = locat + 1
    If Mid(LCase(pinyin), locat, 1) = "(" Then transcriptie = transcriptie + "(": locat = locat + 1
    If Mid(LCase(pinyin), locat, 1) = ")" Then transcriptie = transcriptie + ")": locat = locat + 1: GoTo nklank
    If Mid(LCase(pinyin), locat, 1) = "?" Then transcriptie = transcriptie + "?": locat = locat + 1: GoTo nklank
    If Mid(LCase(pinyin), locat, 1) = "!" Then transcriptie = transcriptie + "!": locat = locat + 1: GoTo nklank
    If Mid(LCase(pinyin), locat, 1) = "." Then transcriptie = transcriptie + ".": locat = locat + 1: GoTo nklank
    
    If Mid(LCase(pinyin), locat, 2) = "zï" Then transcriptie = transcriptie + zi: locat = locat + 1: uitleg = uitleg + zi_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 2) = "cï" Then transcriptie = transcriptie + ci: locat = locat + 1: uitleg = uitleg + ci_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 2) = "sï" Then transcriptie = transcriptie + si: locat = locat + 1: uitleg = uitleg + si_om + Chr(13) + Chr(10): GoTo lklank
    
    If Mid(LCase(pinyin), locat, 3) = "zhï" Then transcriptie = transcriptie + zhi: locat = locat + 2: uitleg = uitleg + zh_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 3) = "chï" Then transcriptie = transcriptie + chi: locat = locat + 2: uitleg = uitleg + ch_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 3) = "shï" Then transcriptie = transcriptie + shi: locat = locat + 2: uitleg = uitleg + sh_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 2) = "rï" Then transcriptie = transcriptie + ri: locat = locat + 1: uitleg = uitleg + r_om + Chr(13) + Chr(10): GoTo lklank
    
    If Mid(LCase(pinyin), locat, 2) = "yu" Then transcriptie = transcriptie + yu: locat = locat + 2: uitleg = uitleg + y_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 2) = "ju" Then transcriptie = transcriptie + ju: locat = locat + 2: uitleg = uitleg + j_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 2) = "qu" Then transcriptie = transcriptie + qu: locat = locat + 2: uitleg = uitleg + q_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 2) = "xu" Then transcriptie = transcriptie + xu: locat = locat + 2: uitleg = uitleg + x_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 3) = "yu " Then transcriptie = transcriptie + yu + " * ": locat = locat + 2: uitleg = uitleg + y_om + Chr(13) + Chr(10): GoTo nklank
    If Mid(LCase(pinyin), locat, 3) = "ju " Then transcriptie = transcriptie + ju + " * ": locat = locat + 2: uitleg = uitleg + j_om + Chr(13) + Chr(10): GoTo nklank
    If Mid(LCase(pinyin), locat, 3) = "qu " Then transcriptie = transcriptie + qu + " * ": locat = locat + 2: uitleg = uitleg + q_om + Chr(13) + Chr(10): GoTo nklank
    If Mid(LCase(pinyin), locat, 3) = "xu " Then transcriptie = transcriptie + xu + " * ": locat = locat + 2: uitleg = uitleg + x_om + Chr(13) + Chr(10): GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "sh" Then transcriptie = transcriptie + sh: locat = locat + 2: uitleg = uitleg + sh_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 2) = "ch" Then transcriptie = transcriptie + ch: locat = locat + 2: uitleg = uitleg + ch_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 2) = "zh" Then transcriptie = transcriptie + zh: locat = locat + 2: uitleg = uitleg + zh_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "h" Then transcriptie = transcriptie + h: locat = locat + 1: uitleg = uitleg + h_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "b" Then transcriptie = transcriptie + b: locat = locat + 1: uitleg = uitleg + b_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "p" Then transcriptie = transcriptie + p: locat = locat + 1: uitleg = uitleg + p_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "d" Then transcriptie = transcriptie + d: locat = locat + 1: uitleg = uitleg + d_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "t" Then transcriptie = transcriptie + t: locat = locat + 1: uitleg = uitleg + t_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "g" Then transcriptie = transcriptie + g: locat = locat + 1: uitleg = uitleg + g_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "k" Then transcriptie = transcriptie + k: locat = locat + 1: uitleg = uitleg + k_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "m" Then transcriptie = transcriptie + m: locat = locat + 1: uitleg = uitleg + m_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "n" Then transcriptie = transcriptie + n: locat = locat + 1: uitleg = uitleg + n_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "l" Then transcriptie = transcriptie + l: locat = locat + 1: uitleg = uitleg + l_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "f" Then transcriptie = transcriptie + f: locat = locat + 1: uitleg = uitleg + f_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "w" Then transcriptie = transcriptie + w: locat = locat + 1: uitleg = uitleg + w_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "y" Then transcriptie = transcriptie + y: locat = locat + 1: uitleg = uitleg + y_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "s" Then transcriptie = transcriptie + s: locat = locat + 1: uitleg = uitleg + s_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "c" Then transcriptie = transcriptie + c: locat = locat + 1: uitleg = uitleg + c_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "z" Then transcriptie = transcriptie + z: locat = locat + 1: uitleg = uitleg + z_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "j" Then transcriptie = transcriptie + j: locat = locat + 1: uitleg = uitleg + j_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "q" Then transcriptie = transcriptie + q: locat = locat + 1: uitleg = uitleg + q_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "x" Then transcriptie = transcriptie + x: locat = locat + 1: uitleg = uitleg + x_om + Chr(13) + Chr(10): GoTo lklank
    If Mid(LCase(pinyin), locat, 1) = "r" Then transcriptie = transcriptie + R: locat = locat + 1: uitleg = uitleg + r_om + Chr(13) + Chr(10): GoTo lklank
lklank:
    If Mid(LCase(pinyin), locat, 4) = "iang" Then transcriptie = transcriptie + end_iang: locat = locat + 4: GoTo nklank
    If Mid(LCase(pinyin), locat, 4) = "iong" Then transcriptie = transcriptie + end_iong: locat = locat + 4: GoTo nklank
    If Mid(LCase(pinyin), locat, 4) = "uang" Then transcriptie = transcriptie + end_uang: locat = locat + 4: GoTo nklank
    If Mid(LCase(pinyin), locat, 3) = "ang" Then transcriptie = transcriptie + end_ang: locat = locat + 3: GoTo nklank
    If Mid(LCase(pinyin), locat, 3) = "eng" Then transcriptie = transcriptie + end_eng: locat = locat + 3: GoTo nklank
    If Mid(LCase(pinyin), locat, 3) = "ong" Then transcriptie = transcriptie + end_ong: locat = locat + 3: GoTo nklank
    If Mid(LCase(pinyin), locat, 3) = "uan" Then transcriptie = transcriptie + end_uan: locat = locat + 3: GoTo nklank
    If Mid(LCase(pinyin), locat, 3) = "üan" Then transcriptie = transcriptie + end_üan: locat = locat + 3: GoTo nklank
    If Mid(LCase(pinyin), locat, 3) = "uai" Then transcriptie = transcriptie + end_uai: locat = locat + 3: GoTo nklank
    If Mid(LCase(pinyin), locat, 3) = "iao" Then transcriptie = transcriptie + end_iao: locat = locat + 3: GoTo nklank
    If Mid(LCase(pinyin), locat, 3) = "ing" Then transcriptie = transcriptie + end_ing: locat = locat + 3: GoTo nklank
    If Mid(LCase(pinyin), locat, 3) = "ian" Then transcriptie = transcriptie + end_ian: locat = locat + 3: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "an" Then transcriptie = transcriptie + end_an: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "ai" Then transcriptie = transcriptie + end_ai: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "ao" Then transcriptie = transcriptie + end_ao: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "ue" Then transcriptie = transcriptie + end_ue: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "üe" Then transcriptie = transcriptie + end_üe: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "en" Then transcriptie = transcriptie + end_en: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "ei" Then transcriptie = transcriptie + end_ei: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "ou" Then transcriptie = transcriptie + end_ou: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "ua" Then transcriptie = transcriptie + end_ua: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "uo" Then transcriptie = transcriptie + end_uo: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "ui" Then transcriptie = transcriptie + end_ui: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "un" Then transcriptie = transcriptie + end_un: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "ün" Then transcriptie = transcriptie + end_ün: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "ia" Then transcriptie = transcriptie + end_ia: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "ie" Then transcriptie = transcriptie + end_ie: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "iu" Then transcriptie = transcriptie + end_iu: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 2) = "in" Then transcriptie = transcriptie + end_in: locat = locat + 2: GoTo nklank
    If Mid(LCase(pinyin), locat, 1) = "a" Then transcriptie = transcriptie + end_a: locat = locat + 1: GoTo nklank
    If Mid(LCase(pinyin), locat, 1) = "o" Then transcriptie = transcriptie + end_o: locat = locat + 1: GoTo nklank
    If Mid(LCase(pinyin), locat, 1) = "e" Then transcriptie = transcriptie + end_e: locat = locat + 1: GoTo nklank
    If Mid(LCase(pinyin), locat, 1) = "u" Then transcriptie = transcriptie + end_u: locat = locat + 1: GoTo nklank
    If Mid(LCase(pinyin), locat, 1) = "ü" Then transcriptie = transcriptie + end_ü: locat = locat + 1: GoTo nklank
    If Mid(LCase(pinyin), locat, 1) = "i" Then transcriptie = transcriptie + end_i: locat = locat + 1: GoTo nklank
    If Mid(LCase(pinyin), locat, 1) = "ï" Then transcriptie = transcriptie + end_i: locat = locat + 1: GoTo nklank

nklank:
'MsgBox transcriptie
Loop
    'MsgBox transcriptie
    ActiveCell.Offset(1, 0).Range("A1").Select
    ActiveCell.Value = transcriptie
    ActiveCell.AddComment
    ActiveCell.Comment.Text Text:=uitleg
    ActiveCell.Comment.Shape.TextFrame.AutoSize = True
    ActiveCell.Comment.Shape.AutoShapeType = msoShapePlaque
    
    ActiveCell.Offset(1, 0).Range("A1").Select
End Sub


Download this snippet    Add to My Saved Code

This code can be used in Excel This will create a transcription from the Chinese language To the Du Comments

No comments have been posted about This code can be used in Excel This will create a transcription from the Chinese language To the Du. Why not be the first to post a comment about This code can be used in Excel This will create a transcription from the Chinese language To the Du.

Post your comment

Subject:
Message:
0/1000 characters