因此就參照了之前所做的『天城體的羅馬轉寫(windows 中的 office)』之巨集,做出了拼音音調之輸入法。對照表如下:
a1 : ā
|
e1 : ē
|
i1 : ī
|
o1 : ō
|
u1 : ū
|
v1 : ǖ
|
a2 : á
|
e2 : é
|
i2 : ì
|
o2 : ó
|
u2 : ú
|
v2 : ǘ
|
a3 : ă
|
e3 : ĕ
|
i3 : ĭ
|
o3 : ŏ
|
u3 : ŭ
|
v3 : ǚ
|
a4 : à
|
e4 : è
|
i4 : í
|
o4 : ò
|
u4 : ù
|
v4 : ǜ
|
之前小學有學過標音調的偈頌:
『有a不放過,無a找oe,iu並排標在後,單個韻母不必說。』
巨集的寫法:
Sub RM_Pinyin_Tones_diacritics()
'
' Pinyin Tones diacritics macro
' Transliteration Comparison reference: https://en.wikipedia.org/wiki/Pinyin
' by Jieli (kkwokxinghuo@gmail.com) 20130825
'
Call replace_inrange("a1", ChrW(&H101))
Call replace_inrange("a2", ChrW(&HE1))
Call replace_inrange("a3", ChrW(&H103))
Call replace_inrange("a4", ChrW(&HE0))
Call replace_inrange("o1", ChrW(&H14D))
Call replace_inrange("o2", ChrW(&HF3))
Call replace_inrange("o3", ChrW(&H14F))
Call replace_inrange("o4", ChrW(&HF2))
Call replace_inrange("e1", ChrW(&H113))
Call replace_inrange("e2", ChrW(&HE9))
Call replace_inrange("e3", ChrW(&H115))
Call replace_inrange("e4", ChrW(&HE8))
Call replace_inrange("i1", ChrW(&H12B))
Call replace_inrange("i2", ChrW(&HEC))
Call replace_inrange("i3", ChrW(&H12D))
Call replace_inrange("i4", ChrW(&HED))
Call replace_inrange("u1", ChrW(&H16B))
Call replace_inrange("u2", ChrW(&HFA))
Call replace_inrange("u3", ChrW(&H16D))
Call replace_inrange("u4", ChrW(&HF9))
Call replace_inrange("v1", ChrW(&H1D6))
Call replace_inrange("v2", ChrW(&H1D8))
Call replace_inrange("v3", ChrW(&H1DA))
Call replace_inrange("v4", ChrW(&H1DC))
End Sub
Sub replace_inrange(c1 As String, c2 As String)
Set myrange = Selection.Range
myrange.Find.ClearFormatting
myrange.Find.Replacement.ClearFormatting
With myrange.Find
.Text = c1
.Replacement.Text = c2
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
myrange.Find.Execute Replace:=wdReplaceAll
End Sub
沒有留言:
張貼留言