Add a fixture for <note> inside <example>, subsense-nested example/note/reversal, and etymology traits
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 84/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- python
- 领域
- testing-qa
调研方向
先从 tests/corpus/ 下的现有文件和 corpus-parametrized tests 开始,然后检查 _reader.py:434、_writer.py:352-353 和 tests/test_property_roundtrip.py。添加一个 version="0.13" 的 fixture,覆盖列出的 example、subsense 和 etymology 形状,并加入语义回读断言以及字节级一致的往返验证;现有的 fidelity、canonical 和 RNG-validity 路径也应通过。
由索引模型根据 Issue 内容生成。
描述
Problem
Example.notes is modeled, parsed (_reader.py:434) and written
(_writer.py:352-353), but no corpus fixture contains a <note> inside an
<example>. The writer's loop body is dead code as far as the suite is concerned,
and the property-based round-trip strategies don't help — _senses() in
tests/test_property_roundtrip.py generates no examples at all.
This was measured by diffing branch coverage of the full 458-test suite against a
run that loads, re-saves and validates 10 real FLEx exports (~29,000 entries, from
sillsdev/TheCombine Backend.Tests/Assets/*.zip). Those exports reach exactly
four arcs the suite does not, all one feature:
_reader.py:434 handlers["note"] = lambda c: example.notes.append(_parse_note(c)) (lambda body)
_writer.py:352 for note in example.notes:
_writer.py:353 el.append(_note_el(note))
FLEx emits these heavily — 2,454 example-notes in one export, 744 in another,
typically <note type="reference"> carrying a scripture citation alongside the
example's translation.
Two further structures in those exports have no corpus instance either (counted
across every tests/corpus/ file: 0 each):
<subsense>carryingexample(with its owntranslationandnote),note,
orreversal.spec-examples/0.13/subsenses.lifthas subsenses, but only with
gloss/definition.<etymology>carrying atrait(FLEx writestrait name="languages").
Proposed fixture
One hand-authored version="0.13" file. These shapes are legal per the RNG, so it
belongs in the regular corpus rather than negative/:
- a sense with an
<example>carrying<translation>,<note type="reference">,
and a<trait> - a
<subsense>carrying its own<example>(with nestedtranslationand
note), a<note>, and two<reversal>elements - an
<etymology>with a<trait>
Shapes drawn from real SIL.FLEx 9.0.7 output, e.g.:
<example source="Luke 1:4">
<form lang="qaa-x-stc"><text>…</text></form>
<translation type="Free translation">
<form lang="en"><text>…</text></form>
</translation>
<note type="reference">
<form lang="en"><text>Luke 1:4</text></form>
</note>
</example>
Assertions: semantic read-back (example.notes, subsense.examples,
etymology.traits — proving the content is modeled rather than carried as
Extras residue) plus byte-identical round-trip. The file also picks up the
existing corpus-parametrized fidelity, canonical, and RNG-validity paths for free.
Why hand-authored rather than importing an export
The exports that surface this are 1.4-12.3 MB of real community lexical data
(Natqgu, Sena) with no per-file provenance recorded in their source repo — the same
permission question as the pending "Enggano export" line in
tests/corpus/PROVENANCE.md. A short fixture closes the coverage gap without
taking that on, or adding megabytes to the repo.
Not included, deliberately
<span lang=...> inside a <definition> looked novel at first — the corpus has 72
spans in definitions, none with @lang. But large/sango/sango.lift already has 45
span[@lang] elsewhere, so the attribute is exercised; only the combination is
absent, and that's not a distinct code path.
- 主要语言
- Python
- 星标
- 1
- 派生
- 0
- 平均合并
- 11 天 8 小时
- 30 天内合并 PR
- 3
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sillsdev/python-sil-lift 的其他 Issue
-
bug
难度 5/5 一周以上 新手友好度 35/100
sillsdev/python-sil-lift#45 ·
-
bug
难度 3/5 1-2 天 新手友好度 72/100
sillsdev/python-sil-lift#35 ·
-
bug
难度 3/5 1-2 天 新手友好度 72/100
sillsdev/python-sil-lift#33 ·
-
Evaluate full API surface for anything unnecessary可能已有人在做 @imnasnainaec 于 18 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 25/100
sillsdev/python-sil-lift#30 · 1 条评论 · 已指派 1 人 ·
-
bug
难度 4/5 3-5 天 新手友好度 45/100
sillsdev/python-sil-lift#29 · 1 条评论 ·
查看 sillsdev/python-sil-lift 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 1/5 1 小时以内 新手友好度 62/100
-
难度 1/5 1 小时以内 新手友好度 70/100
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
topoteretes/cognee#5773 ·
维护者通常 1 天内回复
-
MiKTeX: a failed build reports no errors because texify --quiet switches the log to file:line: style未关闭
难度 2/5 1-3 小时 新手友好度 74/100
SublimeText/LaTeXTools#1718 ·