Skip to content

Commit

Permalink
0220
Browse files Browse the repository at this point in the history
  • Loading branch information
osfans committed Feb 20, 2025
1 parent ee10abc commit 9882376
Show file tree
Hide file tree
Showing 114 changed files with 116,361 additions and 8,280 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ build/
*.doc
*.docx
*.pyc
*.zip
__pycache__
yedict/
揚州同音字表*.tsv
4 changes: 2 additions & 2 deletions tools/tables/_縣志.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ def 統(自, 行):
elif in ("江山廿八都",):
= re.sub("([&@])(?!{)","{\\1}",)
= .replace("&{","{&").replace("@{","{@")
elif in ("樅陽","潛山","靑陽客籍話"):
elif in ("樅陽雨壇","潛山","靑陽客籍話"):
= .replace("*", "□")
elif in ("寶雞"):
= .replace("{Ø}", ").replace("{h}", "h")
= .replace("{Ǿ}", "Ø")
elif in ("南雄珠璣巷"):
= re.sub(r"(\d+)", "[\\1]", )
elif in ("樅陽東",):
Expand Down
6 changes: 3 additions & 3 deletions tools/tables/_表.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ def docx2tsv(doc):
for p in cell.paragraphs:
+= "".join(map(run2text, p.runs)).replace("\t", "").replace("\n", "")
+= "\t"
lines.append(.replace("}~", "~}").replace("~{", "{~").replace("}{", "").strip())
lines.append(.replace("}~", "~}").replace("~{", "{~").replace("}{", "").replace("{h}", "h").strip())
elif isinstance(each, docx.oxml.text.paragraph.CT_P):
element = Paragraph(each, Doc)
= "".join(map(run2text, element.runs)).replace("}~", "~}").replace("~{", "{~").replace("}{", "")
= "".join(map(run2text, element.runs)).replace("}~", "~}").replace("~{", "{~").replace("}{", "").replace("{h}", "h")
lines.append()
= "\n".join(lines).replace("}\n{", "")
t = open(tsv, "w", encoding="U8", newline="\n")
Expand Down Expand Up @@ -238,7 +238,7 @@ def spath(自):
sname = g[0]
.文件名 = os.path.basename(sname)
if isXls(sname):
page = 1 if .簡稱 in ("中山石岐", "通城大坪", "1796建甌") else 0
page = 1 if .簡稱 in ("中山石岐", "通城大坪", "1796建甌", "中山南蓢") else 0
if .簡稱 == "開平護龍": page = 3
xls2tsv(sname, page)
sname = getTsvName(sname)
Expand Down
2 changes: 1 addition & 1 deletion tools/tables/_跳跳老鼠.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def 析(自, 列):
elif in ("長沙雙江",):
聲韻, 調, _, = [:4]
= .normS()
elif in ("會同髙椅","會同靑朗", "臨武"):
elif in ("會同髙椅","會同靑朗", "臨武", "永修梅棠"):
聲韻, _, 調, = [:4]
elif in ("1884甯城",):
_,_,,, = [:5]
Expand Down
10 changes: 10 additions & 0 deletions tools/tables/_音典.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import re

class (_表):
= ""

def (, ):
= .簡稱
Expand Down Expand Up @@ -208,6 +209,12 @@ def 析(自, 列):
音標 = + + 調值
elif in ("上饒沙溪",):
, , _, = [:4]
elif in ("台山大江",):
, 音標, _, = [:4]
if not :
= .
else:
. =
elif in ("1818漳州",):
, = [0], [4]
elif in ("榮縣",):
Expand Down Expand Up @@ -246,6 +253,9 @@ def 析(自, 列):
elif in ("宜章梅田",):
,,,調, = [:5]
= + + 調
elif in ("中山南蓢",):
, , , 調值, = [7], [12], [13], [14], [18]
音標 = + + 調值
elif in ("蒼南宜山",):
,,調,, = [:5]
調 = 調.strip("[]")
Expand Down
Loading

0 comments on commit 9882376

Please sign in to comment.