-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAccentCatalog.py
177 lines (172 loc) · 12.9 KB
/
AccentCatalog.py
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# https://raw.githubusercontent.com/openscriptures/morphhb/master/structure/OshbVerse/Script/AccentCatalog.js
#
# Modified from the js...
#
accentCatalog = {
"prose": {
"\u05C3": {"name": "Sof Pasuq", "rank": "0", "type": "disjunctive", "final": "true"},
"\u0596\u05C3": {"name": "Mëayla with Sof Pasuq", "rank": "0", "type": "disjunctive", "final": "true"},
"\u05A5\u05C3": {"name": "Merkha with Sof Pasuq", "rank": "0", "type": "disjunctive", "final": "true"},
"\u0591": {"name": "Atnach", "rank": "0", "type": "disjunctive"},
"\u0596\u0591": {"name": "Mëayla with Atnach", "rank": "0", "type": "disjunctive"},
"\u05A3\u0591": {"name": "Munnach with Atnach", "rank": "0", "type": "disjunctive"},
"\u05A5\u0591": {"name": "Merkha with Atnach", "rank": "0", "type": "disjunctive"},
"\u0591\u0599": {"name": "Atnach with Pashta", "rank": "0", "type": "disjunctive"},
"\u0592": {"name": "Segol", "rank": "1", "type": "disjunctive"},
"\u0593\u05C0": {"name": "Shalshelet", "rank": "1", "type": "disjunctive"},
"\u0594": {"name": "Zaqef Qatan", "rank": "1", "type": "disjunctive"},
"\u05A3\u0594": {"name": "Munnach with Zaqef Qatan", "rank": "1", "type": "disjunctive"},
"\u05A8\u0594": {"name": "Qadma with Zaqef Qatan", "rank": "1", "type": "disjunctive"},
"\u0595": {"name": "Zaqef Gadol", "rank": "1", "type": "disjunctive"},
"\u0596": {"name": "Tipcha", "rank": "1", "type": "disjunctive", "final": "true"},
"\u05A5\u0596": {"name": "Merkha with Tipcha", "rank": "1", "type": "disjunctive", "final": "true"},
"\u0597": {"name": "Revia", "rank": "2", "type": "disjunctive"},
"\u05A0\u0597": {"name": "Telisha Gedola with Revia", "rank": "2", "type": "disjunctive"},
"\u05A3\u0597": {"name": "Munnach with Revia", "rank": "2", "type": "disjunctive"},
"\u05AE": {"name": "Zarqa", "rank": "2", "type": "disjunctive", "final": "true"},
"\u0598\u05AE": {"name": "Zarqa", "rank": "2", "type": "disjunctive", "final": "true"},
"\u0599": {"name": "Pashta", "rank": "2", "type": "disjunctive", "final": "true"},
"\u0599\u0599": {"name": "Pashta", "rank": "2", "type": "disjunctive", "final": "true"},
"\u05A8\u0599": {"name": "Pashta", "rank": "2", "type": "disjunctive", "final": "true"},
"\u05A4\u0599": {"name": "Mahpakh with Pashta", "rank": "2", "type": "disjunctive", "final": "true"},
"\u05A4\u0599\u0599": {"name": "Mahpakh with Pashta", "rank": "2", "type": "disjunctive", "final": "true"},
"\u05A4\u05A8\u0599": {"name": "Mahpakh with Pashta", "rank": "2", "type": "disjunctive", "final": "true"},
"\u059A": {"name": "Yetiv", "rank": "2", "type": "disjunctive", "final": "true"},
"\u059B": {"name": "Tevir", "rank": "2", "type": "disjunctive", "final": "true"},
"\u05A5\u059B": {"name": "Merkha with Tevir", "rank": "2", "type": "disjunctive", "final": "true"},
"\u05A1": {"name": "Pazer", "rank": "3", "type": "disjunctive"},
"\u05A3\u05A1": {"name": "Munnach with Pazer", "rank": "3", "type": "disjunctive"},
"\u059F": {"name": "Qarney Para", "rank": "3", "type": "disjunctive"},
"\u05A0": {"name": "Telisha Gedola", "rank": "3", "type": "disjunctive"},
"\u05A0\u05A0": {"name": "Telisha Gedola", "rank": "3", "type": "disjunctive"},
"\u059D\u05A0": {"name": "Geresh Muqdam with Telisha Gedola", "rank": "3", "type": "disjunctive", "final": "true"},
"\u059C": {"name": "Geresh", "rank": "3", "type": "disjunctive", "final": "true"},
"\u05A0\u059C": {"name": "Telisha Gedola with Geresh", "rank": "3", "type": "disjunctive", "final": "true"},
"\u05A8\u059C": {"name": "Qadma with Geresh", "rank": "3", "type": "disjunctive", "final": "true"},
"\u059D": {"name": "Geresh Muqdam", "rank": "3", "type": "disjunctive", "final": "true"},
"\u059E": {"name": "Gershayim", "rank": "3", "type": "disjunctive", "final": "true"},
"\u05A0\u059E": {"name": "Telisha Gedola with Gershayim", "rank": "3", "type": "disjunctive", "final": "true"},
"\u059E\u05A0": {"name": "Gershayim with Telisha Gedola", "rank": "3", "type": "disjunctive", "final": "true"},
"\u05A3\u05C0": {"name": "Legarmeh", "rank": "3", "type": "disjunctive", "final": "true"},
"\u05C0": {"name": "Paseq", "rank": "4", "type": "conjunctive"},
"\u05A5\u05A3\u05C0": {"name": "Merkha and Munnach with Paseq", "rank": "4", "type": "conjunctive"},
"\u05A4\u05C0": {"name": "Mahpakh with Paseq", "rank": "4", "type": "conjunctive"},
"\u05A5\u05C0": {"name": "Merkha with Paseq", "rank": "4", "type": "conjunctive"},
"\u05A7\u05C0": {"name": "Darga with Paseq", "rank": "4", "type": "conjunctive"},
"\u05A8\u05C0": {"name": "Qadma with Paseq", "rank": "4", "type": "conjunctive"},
"\u05A8\u05A5\u05C0": {"name": "Qadma and Merkha with Paseq", "rank": "4", "type": "conjunctive"},
"\u05A9\u05C0": {"name": "Telisha Qetana with Paseq", "rank": "4", "type": "conjunctive"},
"\u05A3": {"name": "Munnach", "rank": "4", "type": "conjunctive"},
"\u05A3\u05A3": {"name": "Munnach with Munnach", "rank": "4", "type": "conjunctive"},
"\u05AA": {"name": "Galgal", "rank": "4", "type": "conjunctive"},
"\u05A5": {"name": "Merkha", "rank": "4", "type": "conjunctive"},
"\u05A8\u05A5": {"name": "Qadma with Merkha", "rank": "4", "type": "conjunctive"},
"\u05A9": {"name": "Telisha Qetana", "rank": "4", "type": "conjunctive"},
"\u05A9\u05A9": {"name": "Telisha Qetana", "rank": "4", "type": "conjunctive"},
"\u05A8": {"name": "Qadma", "rank": "4", "type": "conjunctive"},
"\u05A4": {"name": "Mahpakh", "rank": "4", "type": "conjunctive"},
"\u05A3\u05A4": {"name": "Munnach with Mahpakh", "rank": "4", "type": "conjunctive"},
"\u05A8\u05A4": {"name": "Qadma with Mahpakh", "rank": "4", "type": "conjunctive"},
"\u05A6": {"name": "Merkha Khefula", "rank": "4", "type": "conjunctive"},
"\u05A7": {"name": "Darga", "rank": "4", "type": "conjunctive"},
"\u05A8\u05A7": {"name": "Qadma with Darga", "rank": "4", "type": "conjunctive"},
"\u05BE": {"name": "Maqqef", "rank": "4", "type": "conjunctive"},
"\u05BD": {"name": "Meteg", "rank": "4", "type": "conjunctive"},
},
"poetic": {
"\u05C3": {"name": "Sof Pasuq", "rank": "0", "type": "disjunctive", "final": "true"},
"\u05A5\u05C3": {"name": "Merkha with Sof Pasuq", "rank": "0", "type": "disjunctive", "final": "true"},
"\u0591": {"name": "Atnach", "rank": "1", "type": "disjunctive", "final": "true"},
"\u05A3\u0591": {"name": "Munnach with Atnach", "rank": "1", "type": "disjunctive", "final": "true"},
"\u05A5\u0591": {"name": "Merkha with Atnach", "rank": "1", "type": "disjunctive", "final": "true"},
"\u0592": {"name": "Segol", "rank": "1", "type": "disjunctive"},
"\u0593\u05C0": {"name": "Shalshelet Gedola", "rank": "1", "type": "disjunctive", "final": "true"},
"\u0594": {"name": "Zaqef Qatan", "rank": "1", "type": "disjunctive"},
"\u05A3\u0594": {"name": "Munnach with Zaqef Qatan", "rank": "1", "type": "disjunctive"},
"\u0595": {"name": "Zaqef Gadol", "rank": "1", "type": "disjunctive"},
"\u0597": {"name": "Revia", "rank": "1", "type": "disjunctive", "final": "true"},
"\u059D\u0597": {"name": "Revia Mugrash", "rank": "1", "type": "disjunctive", "final": "true"},
"\u05A5\u0597": {"name": "Merkha with Revia", "rank": "1", "type": "disjunctive", "final": "true"},
"\u059D\u05A5\u0597": {"name": "Merkha with Revia Mugrash", "rank": "1", "type": "disjunctive", "final": "true"},
"\u0598\u05A4\u0597": {"name": "Mahpakh Metsunnar with Revia", "rank": "1", "type": "disjunctive", "final": "true"},
"\u05AD\u0597": {"name": "Dechi with Revia", "rank": "1", "type": "disjunctive", "final": "true"},
"\u05A1": {"name": "Pazer", "rank": "1", "type": "disjunctive", "final": "true"},
"\u05A1\u05C0": {"name": "Pazer with Paseq", "rank": "1", "type": "disjunctive", "final": "true"},
"\u05AA\u05A1": {"name": "Galgal with Pazer", "rank": "1", "type": "disjunctive", "final": "true"},
"\u05A4\u05C0": {"name": "Mahpakh Legarmeh", "rank": "1", "type": "disjunctive", "final": "true"},
"\u05AB": {"name": "Ole", "rank": "1", "type": "disjunctive"},
"\u05A4\u05AB": {"name": "Mahpakh with Ole", "rank": "1", "type": "disjunctive"},
"\u05AB\u05A5": {"name": "Ole We Yored", "rank": "1", "type": "disjunctive"},
# "\u05A5": {"name": "Yored", "rank": "1", "type": "disjunctive"},
"\u05A8\u05C0": {"name": "Azla Legarmeh", "rank": "1", "type": "disjunctive"},
"\u05A4\u05A8\u05C0": {"name": "Mahpakh with Azla Legarmeh", "rank": "1", "type": "disjunctive"},
"\u0599": {"name": "Pashta", "rank": "2", "type": "disjunctive", "final": "true"},
"\u0599\u0599": {"name": "Pashta", "rank": "2", "type": "disjunctive", "final": "true"},
"\u05A8\u0599": {"name": "Pashta", "rank": "2", "type": "disjunctive", "final": "true"},
"\u059A": {"name": "Yetiv", "rank": "2", "type": "disjunctive", "final": "true"},
"\u059B": {"name": "Tevir", "rank": "2", "type": "disjunctive", "final": "true"},
"\u05AD": {"name": "Dechi", "rank": "2", "type": "disjunctive", "final": "true"},
"\u05AE": {"name": "Tsinnor", "rank": "2", "type": "disjunctive", "final": "true"},
"\u05A0": {"name": "Telisha Gedola", "rank": "3", "type": "disjunctive"},
"\u059C": {"name": "Geresh", "rank": "3", "type": "disjunctive", "final": "true"},
"\u059D": {"name": "Geresh Muqdam", "rank": "3", "type": "disjunctive", "final": "true"},
"\u059E": {"name": "Gershayim", "rank": "3", "type": "disjunctive", "final": "true"},
# "\u05AB": {"name": "Ole", "rank": "1", "type": "conjunctive"},
"\u05C0": {"name": "Paseq", "rank": "4", "type": "conjunctive"},
"\u05A3": {"name": "Munnach", "rank": "4", "type": "conjunctive"},
"\u0596\u05A3": {"name": "Tarcha with Munnach", "rank": "4", "type": "conjunctive"},
"\u05A3\u05A3": {"name": "Munnach", "rank": "4", "type": "conjunctive"},
"\u05A4\u05A3": {"name": "Mahpakh with Munnach", "rank": "4", "type": "conjunctive"},
"\u05A3\u05A5": {"name": "Munnach with Merkha", "rank": "4", "type": "conjunctive"},
"\u05A3\u05C0": {"name": "Munnach with Paseq", "rank": "4", "type": "conjunctive"},
"\u05A4\u05A3\u05C0": {"name": "Mahpakh and Munnach with Paseq", "rank": "4", "type": "conjunctive"},
"\u05AD\u05A3": {"name": "Dechi with Munnach", "rank": "4", "type": "conjunctive"},
"\u05A3\u05AD": {"name": "Dechi with Munnach", "rank": "4", "type": "conjunctive"},
"\u05A5\u05A8": {"name": "Merkha with Qadma", "rank": "4", "type": "conjunctive"},
"\u05A7": {"name": "Darga", "rank": "4", "type": "conjunctive"},
"\u05A8\u05A7": {"name": "Qadma with Darga", "rank": "4", "type": "conjunctive"},
"\u05A9": {"name": "Telisha Qetana", "rank": "4", "type": "conjunctive"},
"\u05AA": {"name": "Atnach Hafukh", "rank": "4", "type": "conjunctive"},
"\u05AA\u05AB": {"name": "Galgal with Ole", "rank": "4", "type": "conjunctive"},
"\u05AA\u05AB\u05A5": {"name": "Galgal and Ole with Merkha", "rank": "4", "type": "conjunctive"},
"\u05AA\u05C0": {"name": "Galgal with Paseq", "rank": "4", "type": "conjunctive"},
"\u05A5": {"name": "Merkha ", "rank": "4", "type": "conjunctive"},
"\u05A5\u05A5": {"name": "Merkha", "rank": "4", "type": "conjunctive"},
"\u05A5\u05C0": {"name": "Merkha with Paseq", "rank": "4", "type": "conjunctive"},
"\u0598\u05A5": {"name": "Merkha Metsunneret", "rank": "4", "type": "conjunctive"},
"\u0598\u05A5\u05C0": {"name": "Tsinnorit and Merkha with Paseq", "rank": "4", "type": "conjunctive"},
"\u05A5\u05A8\u05C0": {"name": "Merkha and Qadma with Paseq", "rank": "4", "type": "conjunctive"},
"\u05AD\u05A5": {"name": "Dechi with Merkha", "rank": "4", "type": "conjunctive"},
"\u0598": {"name": "Tsinnorit", "rank": "4", "type": "conjunctive"},
"\u0593": {"name": "Shalshelet Qetana", "rank": "4", "type": "conjunctive"},
"\u0596": {"name": "Tarcha", "rank": "4", "type": "conjunctive"},
"\u05A8": {"name": "Qadma", "rank": "4", "type": "conjunctive"},
"\u05AC": {"name": "Illuy", "rank": "4", "type": "conjunctive"},
"\u05AC\u05C0": {"name": "Illuy with Paseq", "rank": "4", "type": "conjunctive"},
"\u05AC\u05A8\u05C0": {"name": "Illuy and Qadma with Paseq", "rank": "4", "type": "conjunctive"},
"\u05A4": {"name": "Mahpakh", "rank": "4", "type": "conjunctive"},
"\u0598\u05A4": {"name": "Mahpakh Metsunnar", "rank": "4", "type": "conjunctive"},
"\u05A4\u05A5": {"name": "Mahpakh with Merkha", "rank": "4", "type": "conjunctive"},
"\u05BE": {"name": "Maqqef", "rank": "4", "type": "conjunctive"},
"\u05BD": {"name": "Meteg", "rank": "4", "type": "conjunctive"},
}
}
# New stuff added from here:
def prose_or_poetry(ref_tuple):
if ref_tuple[0] in ["Psalms","Job","Proverbs"]:
if ref_tuple[0] == "Job":
if ref_tuple[1] < 3 or (ref_tuple[1] == 42 and ref_tuple[2] > 6) or ref_tuple == ("Job", 3, 1):
return "prose"
return "poetic"
else:
return "prose"
def dataFromAccentCombo(accent_combo, ref_tuple):
accent_type = prose_or_poetry(ref_tuple)
if accent_combo in accentCatalog[accent_type]:
return accentCatalog[accent_type][accent_combo]
else:
# 05BD = meteg (sometimes just for the sake of pronunciation)
# We are also going to swallow up silluq
if "\u05BD" in accent_combo:
return dataFromAccentCombo(accent_combo.replace("\u05BD", ""), ref_tuple)
return False