Skip to content

Commit

Permalink
1228
Browse files Browse the repository at this point in the history
  • Loading branch information
osfans committed Dec 29, 2024
1 parent 7f4b4df commit 256d661
Show file tree
Hide file tree
Showing 96 changed files with 81,531 additions and 43,443 deletions.
12 changes: 6 additions & 6 deletions tools/tables/_縣志.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def format(self, line):
line = re.sub(r"^(.*?)[", "\\1 [", line)
elif name in ("寶應望直港","羅山周黨","涇縣茂林","沁源", "同江二屯","象山鶴浦","趙縣"):
line = re.sub(r"^(.*?) ?\[", "\\1 [", line)
elif name in ("萍鄕","平陽","都昌陽峯"):
line = line.lstrip("∅︀")
elif name in ("遂川","大庸","大庸三眼橋", "婺川", "蒙山程村"):
elif name in ("永州嵐角山"):
line = line.lstrip("ø")
elif name in ("遂川","大庸南","大庸北", "婺川", "蒙山程村"):
line = re.sub(r"\[(\d+)\]", lambda x:"[%s]"%self.dz2dl(x[1]), line)
elif name in ("奉化",):
line = re.sub(r"(\d+)(?![:\d])", lambda x:"[%s]"%self.dz2dl(x[1]), line)
Expand Down Expand Up @@ -106,7 +106,7 @@ def format(self, line):
line = self.normS(line, "{\\1}")
elif name in ("通道菁蕪洲",):
line = re.sub("([&])(?!{)","{西官借詞}",line).replace("&{","{(西官借詞)")
elif name in ("泰興","無爲牛埠"):
elif name in ("泰興","無爲牛埠","淮陰"):
line = line.lstrip("q")
elif name in ("壺關樹掌"):
line = line.lstrip("q").replace("·", "0")
Expand Down Expand Up @@ -136,7 +136,7 @@ def format(self, line):
elif name in ("虔南大吉山",):
line = re.sub(r"\[.*?(\d+)\]", lambda x:"[%s]"%self.dz2dl(x[1]), line)
line = line.replace("<","{").replace(">","}")
elif name in ("澄海大新","光山", "南康唐江", "仁化長江", "永豐", "南豐"):
elif name in ("澄海大新","光山", "南康唐江", "仁化長江", "永豐", "南豐","崇左大新"):
line = re.sub(r"\[(\d+)\]", lambda x:"[%s]"%self.dz2dl(x[1]), line)
elif name in ("耒陽",):
line = line.replace("51", "53")
Expand Down Expand Up @@ -247,7 +247,7 @@ def format(self, line):
line = re.sub(r"([?#\-\+])(.)", "\\2\\1", line)
line = line.replace("-", "(舊)").replace("+", "/").replace("?", "?").replace("#", "*")
elif name in ("黨項",):
line = re.sub(r"(.\{)", "[0]\\1", line)
line = re.sub(r"(.\{)", "[0]\\1", line, count=1)
return line

def parseYm(self, line):
Expand Down
8 changes: 5 additions & 3 deletions tools/tables/_表.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def normAll(self, yb):
def normYb(self, yb):
if self.isLang() and self.isYb:
yb = yb.strip()
yb = yb.replace("Ǿ", "Ǿ").replace("Ǿ", "").lstrip("0∅Ø〇").replace("零", "")
yb = yb.replace("Ǿ", "Ǿ").replace("Ǿ", "").lstrip("∅︀0∅Ø〇").replace("零", "")
if yb.startswith("I") or yb.startswith("1"): yb = "l" + yb[1:]
yb = yb.lower().replace("g", "ɡ").replace("ʼ", "ʰ").replace("'", "ʰ")
if not yb.startswith("h") and "h" in yb:
Expand All @@ -295,10 +295,12 @@ def normYb(self, yb):
def checkYb(self, yb):
yb = self.normYb(yb)
if "\t" in yb:
self.errors.append(f"{yb} 音節有空格")
self.errors.append(f"{yb} 音節有TAB空檔")
yb = yb.replace("\t", "")
if isHZ(yb[0]):
self.errors.append(f"{yb} 音節有錯誤")
self.errors.append(f"{yb} 音節錯誤")
if re.match(r".+\d{3,}", yb):
self.errors.append(f"{yb} 調類錯誤")
if yb not in self.ybs:
self.ybs.add(yb)
else:
Expand Down
2 changes: 1 addition & 1 deletion tools/tables/_跳跳老鼠.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def parse(self, fs):
_, sy, sd, hzs = fs[:4]
sd = sd.strip("[]")
hzs = self.normG(hzs, "[\\1]")
elif name in ("灌陽",):
elif name in ("灌陽","全州文橋"):
sy, sd, hzs = fs[:3]
hzs = self.normG(hzs, "[\\1]")
elif name in ("江華河路口", "江華粟米塘", "全州黃沙河", "安仁新洲", "1935長沙", "長沙黃花", "瀏陽鎭頭"):
Expand Down
21 changes: 21 additions & 0 deletions tools/tables/_音典.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def parse(self, fs):
elif name in ("劍川金華",):
hz, sy, sd, js = fs[:4]
yb = sy + sd
elif name in ("樂昌黃圃",):
hz, sd, sy, js = fs[:4]
yb = sy + sd
js = js.strip("{}")
elif name in ("1926綜合",):
hz,yb,_,_,_,js = fs[:6]
elif name in ("蒼南錢庫",):
Expand Down Expand Up @@ -65,6 +69,11 @@ def parse(self, fs):
elif name in ("遂昌","五華橫陂","蔡家話"):
hz, sy, sd, js = fs[:4]
ipa = sy + sd
elif name in ("雙牌打鼓坪"):
sy, sd, _, js = fs[:4]
yb = sy + sd
hz = js[0]
js = js[1:].strip("()()")
elif name in ("開化",):
hz, js, sm, ym, sd = fs[:5]
yb = sm + ym + sd.strip("[]")
Expand Down Expand Up @@ -181,6 +190,18 @@ def parse(self, fs):
for y,j in zip(yb.split(" "), js.split(" ")):
l.append((hz, y, j))
return l
elif name in ("1925鹽城"):
hzs, yb, js = fs[:3]
l = list()
for hz in hzs.split(" "):
if len(hz) == 2:
js = f"({hz}{js}".strip()
hz = hz[0]
elif len(hz) > 2:
js = f"{hz[1:]}{js}".strip()
hz = hz[0]
l.append((hz, yb, js))
return l
elif name in ("陽春河口",):
hz, sm, ym, sd, js = fs[9], fs[6], fs[7], fs[4].split("\\")[0], fs[10]
yb = sm + ym + sd
Expand Down
Loading

0 comments on commit 256d661

Please sign in to comment.