Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add a fixture for <note> inside <example>, subsense-nested example/note/reversal, and etymology traits

Đang mở Phù hợp với người mới
#15 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
testing-qa

Hướng nghiên cứu

Bắt đầu với các tệp hiện có trong tests/corpus/ và các bài kiểm thử được tham số hóa theo corpus, sau đó kiểm tra _reader.py:434, _writer.py:352-353 và tests/test_property_roundtrip.py. Thêm một fixture với version="0.13" bao phủ các dạng example, subsense và etymology được liệt kê, kèm các assertion read-back mang tính ngữ nghĩa và việc xác thực round-trip giống hệt từng byte; các đường dẫn fidelity, canonical và RNG-validity hiện có cũng phải vượt qua.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

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> carrying example (with its own translation and note), note,
    or reversal. spec-examples/0.13/subsenses.lift has subsenses, but only with
    gloss/definition.
  • <etymology> carrying a trait (FLEx writes trait 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 nested translation and
    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.

Ngôn ngữ chính
Python
Star
1
Fork
0
Merge trung bình
9 ngày 17 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sillsdev/python-sil-lift

Tất cả issue của sillsdev/python-sil-lift

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.