-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.typ
More file actions
118 lines (115 loc) · 2.53 KB
/
data.typ
File metadata and controls
118 lines (115 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/// Dictionary mapping Jyutping initials to Jyutcitzi part 1 and combine mode
#let initials-dict = (
a: ("⺍", "⺌", "-"),
b: ("比", "-"),
p: ("并", "|"),
m: ("文", "-"),
f: ("夫", "|"),
d: ("大", "-"),
t: ("天", "-"),
n: ("乃", "|"),
l: ("力", "|"),
g: ("丩", "|"),
k: ("臼", "-"),
h: ("亾", "|"),
z: ("止", "|"),
c: ("此", "-"),
s: ("厶", "-"),
j: ("央", "-"),
w: ("禾", "-"),
gw: ("古", "|"),
kw: ("夸", "|"),
ng: (scale([乂乂], x: 50%, reflow: true), "爻", "-"),
)
/// Return the Jyutcitzi for syllabic nasal sounds:
/// `m` / `ng` → "一乂一 with 、"; otherwise → "一乂一 without 、"
#let syllabic-nasal-char(jp-final) = {
set text(bottom-edge: "descender", top-edge: "ascender")
let part13 = scale([一], 90%)
let part22 = scale([乂], 75%)
let dot-box = box(text(bottom-edge: "descender", top-edge: "bounds")[ˎ])
let dot-dy = if jp-final == "m" { -0.2em } else if jp-final == "ng" { 0.2em }
let dot-pos = if jp-final == "m" { bottom + right } else if jp-final == "ng" { top + right }
box(baseline: 0.12em)[
#place(part13, dy: 0.4em)
#part22
#place(bottom, part13, dy: -0.3em)
#if jp-final == "m" or jp-final == "ng" {
place(dot-pos, dy: dot-dy, dot-box)
}
]
}
/// Dictioary mapping Jyutping finals to Jyutcitzi part 2
#let finals-dict = (
aa: ("乍",),
aai: ("介",),
aau: ("丂",),
aam: ("彡",),
aan: ("万",),
aang: ("生",),
aap: ("甲",),
aat: ("压",),
aak: ("百",),
ai: ("兮",),
au: ("久",),
am: ("今",),
an: ("云",),
ang: ("亙",),
ap: ("十",),
at: ("乜",),
ak: ("仄",),
e: ("旡",),
ei: ("丌",),
eu: ("了",),
em: ("壬",),
en: ("円",),
eng: ("正",),
ep: ("夾",),
et: ("犮", "叐"),
ek: ("尺",),
i: ("子",),
iu: ("么",),
im: ("欠",),
"in": ("千",),
ing: ("丁",),
ip: ("頁",),
it: ("必",),
ik: ("夕",),
o: ("个",),
oi: ("丐",),
ou: ("冇",),
on: ("干",),
ong: ("王",),
ot: ("匃", "曷"),
ok: ("乇",),
u: ("乎",),
ui: ("会",),
un: ("本",),
ung: ("工",),
ut: ("末",),
uk: ("玉",),
oe: ("居",),
oeng: ("丈",),
oek: ("勺",),
eoi: ("句",),
eon: ("卂",),
eot: ("朮",),
yu: ("仒",),
yun: ("元",),
yut: ("乙",),
mng: (syllabic-nasal-char(""), "乂", "㐅"),
m: (syllabic-nasal-char("m"), "太"),
ng: (syllabic-nasal-char("ng"), "犬"),
)
// Tone map for Jyutcitzi
#let tone-map = (
"1": "'",
"2": "´",
"3": "`",
"4": "\"",
"5": "˝",
"6": "゙",
"7": "'",
"8": "`",
"9": "゙",
)