Skip to content

Commit

Permalink
1220
Browse files Browse the repository at this point in the history
  • Loading branch information
osfans committed Dec 20, 2024
1 parent 304e64e commit d7049dd
Show file tree
Hide file tree
Showing 47 changed files with 38,349 additions and 3,186 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
applicationId "com.osfans.mcpdict"
minSdkVersion 24
targetSdkVersion 34
versionCode 97
versionCode 98
versionName "5.7"
}

Expand Down
3 changes: 3 additions & 0 deletions tools/tables/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ def getLangs(dicts, argv, 省=None):
continue
if d["繁簡"] == "简": lang.simplified = 2
if d["地圖集二分區"] == None: d["地圖集二分區"] = ""
if "聯表列名" in d:
a = d["聯表列名"].upper()
lang.ybIndex = sum([26**(len(a)-1-i)*(ord(j)-ord('A')+1) for i,j in enumerate(a)]) - 1
addAllFq(types[0], d["地圖集二分區"], d["地圖集二排序"])
addAllFq(types[1], d["音典分區"], d["音典排序"])
addCfFq(types[2], d["陳邡分區"], d["陳邡排序"])
Expand Down
2 changes: 1 addition & 1 deletion tools/tables/_縣志.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def format(self, line):
line = re.sub(r"^(.*?) ?\[", "\\1 [", line)
elif name in ("萍鄕","平陽","都昌陽峯"):
line = line.lstrip("∅︀")
elif name in ("遂川","大庸","大庸三眼橋", "婺川", "電白霞洞"):
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
1 change: 1 addition & 0 deletions tools/tables/_表.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class 表:
kCompatibilityVariants = getCompatibilityVariants()
simplified = 1
isYb = True
ybIndex = None
syds = defaultdict(set)
d = defaultdict(list)
__mod = None
Expand Down
3 changes: 3 additions & 0 deletions tools/tables/_詳情.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def load(省):
音系 = fs["音系"]
說明 = fs["說明"]
繁簡 = fs["繁簡"]
聯表列名 = fs["聯表列名"]
字表格式 = fs["字表格式"]
經緯度 = normJW(fs["經緯度"])
方言島 = fs["方言島"] == "☑"
Expand Down Expand Up @@ -204,6 +205,8 @@ def load(省):
"繁簡":繁簡,
"聲調":聲調
}
if 聯表列名:
d[簡稱]["聯表列名"] = 聯表列名
if not 經緯度: continue
Feature = {
"type": "Feature",
Expand Down
3 changes: 3 additions & 0 deletions tools/tables/_跳跳老鼠.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ def parse(self, fs):
elif name in ("邵東斫曹","綏寧武陽","天柱江東"):
sy, sd = fs[:2]
hzs = "".join(fs[2:]).replace("\t", "").strip()
elif name in ("1930淮安",):
_, sy, sd, hzs = fs[:4]
hzs = self.normS(hzs)
elif name in ("吉安雲樓",):
sy, sd, hzs = fs[:3]
hzs = self.normS(hzs)
Expand Down
64 changes: 34 additions & 30 deletions tools/tables/_音典.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,34 +186,6 @@ def parse(self, fs):
for y,j in zip(yb.split(" "), js.split(" ")):
l.append((hz, y, j))
return l
elif name in (names := ("電白龍山", "羅定漳州話")):
if len(fs) < 6: return
hz = fs[0]
index = names.index(name) + 2
ybs = fs[index]
ybs = ybs.replace("/", "/")
if not ybs or ybs.startswith("—"): return
_js = hz[1:] if len(hz)>1 else ""
_js = _js.strip("()")
hz = hz[0]
l = list()
for _yb in ybs.split("/"):
_yb = _yb.strip()
c = ""
if "(" in _yb:
n = _yb.index("(")
c = _yb[n:]
_yb = _yb[:n]
yb = self.dz2dl(_yb)
js = c + _js
if js.startswith("(") and js.endswith(")"):
js = js[1:-1]
l.append((hz, yb, js))
return l
elif name in (indexes := {'沅陵深溪口': 2, '沅陵麻溪鋪': 5, '沅陵淸水坪': 12, '沅陵棋坪': 15, '古丈髙峯': 18, '瀘溪八什坪': 29, '瀘溪': 32, '沅陵丑溪口': 35, '沅陵渭溪': 38, '漵浦木溪': 41}):
index = indexes[name]
hz, js = fs[:2]
yb = "".join(fs[index:index+3])
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 Expand Up @@ -278,12 +250,44 @@ def parse(self, fs):
hz, yb, js = fs[:3]
elif name in ("建陽連墩",):
hz, yb, js = fs[:3]
elif name in ("丹陽雲陽", "丹陽訪仙", "丹陽河陽", "丹陽埤城"):
elif self._file.startswith("粤西闽语方言字表"):
if len(fs) < 6: return
hz = fs[0]
ybs = fs[self.ybIndex]
ybs = ybs.replace("/", "/")
if not ybs or ybs.startswith("—"): return
_js = hz[1:] if len(hz)>1 else ""
_js = _js.strip("()")
hz = hz[0]
l = list()
for _yb in ybs.split("/"):
_yb = _yb.strip()
c = ""
if "(" in _yb:
n = _yb.index("(")
c = _yb[n:]
_yb = _yb[:n]
yb = self.dz2dl(_yb)
js = c + _js
if js.startswith("(") and js.endswith(")"):
js = js[1:-1]
l.append((hz, yb, js))
return l
elif self._file.startswith("鄉話"):
index = self.ybIndex
hz, js = fs[:2]
yb = "".join(fs[index:index+3])
elif self._file.startswith("丹陽(雲陽訪仙河陽埤城)"):
hz = fs[0][0]
if hz.startswith("["): return
js = fs[0][1:].strip("()()")
yb = fs[1:][("丹陽雲陽", "丹陽訪仙", "丹陽河陽", "丹陽埤城").index(name)]
yb = fs[self.ybIndex]
yb = self.dz2dl(yb)
elif self._file.startswith("广西富川富阳方言21点"):
if not fs[0]: return
hz = fs[0][0]
js = fs[0][1:].strip("()()")
yb = self.dz2dl(fs[self.ybIndex])
elif len(fs) >= 4:
hz, _, ipa, js = fs[:4]
elif len(fs) == 2:
Expand Down
Loading

0 comments on commit d7049dd

Please sign in to comment.