diff --git a/actions/build_dashboard.py b/actions/build_dashboard.py index 5803920..8c57ee7 100644 --- a/actions/build_dashboard.py +++ b/actions/build_dashboard.py @@ -365,7 +365,7 @@ panel({ { key: "status", label: "状态", order: ["new","learning","known"], def: "learning", fixed: true, names: { new: "未学", learning: "学习中", known: "已掌握" } }, ], fields: ["item", "meaning", "context"], - head: `id条目等级释义上下文状态`, + head: `id条目等级释义例句状态`, row: i => `${esc(i.id)}${esc(i.item)}${esc(i.level)}${esc(i.meaning)}${esc(i.context)}${badge(i.status)}`, }); """ diff --git a/actions/fill_context.py b/actions/fill_context.py index 463710c..5f80794 100644 --- a/actions/fill_context.py +++ b/actions/fill_context.py @@ -43,8 +43,10 @@ def load_sentences() -> list[str]: d = re.sub(r"\[[^\]]*\]", " ", d) d = re.sub(r"\([^)]*\)", " ", d) d = re.sub(r"\s+", " ", d).strip() - if 4 <= len(d) <= 240: - out.append(d) + cands = [d] if (d[:1].isupper() and d[-1:] in ".!?") else [s.strip() for s in re.findall(r"[^.!?]*[.!?]", d)] + for s in cands: + if s[:1].isupper() and s[-1:] in ".!?" and 5 <= len(s.split()) <= 28: + out.append(s) return out diff --git a/me/lang.db b/me/lang.db index 06db68f..0202537 100644 Binary files a/me/lang.db and b/me/lang.db differ