Skip to content

fix: WordNet lex_filename + adjective markers and FrameNet FE constraints#10

Merged
aaronstevenwhite merged 6 commits into
mainfrom
fix/wordnet-framenet-converter-issues
Jun 25, 2026
Merged

fix: WordNet lex_filename + adjective markers and FrameNet FE constraints#10
aaronstevenwhite merged 6 commits into
mainfrom
fix/wordnet-framenet-converter-issues

Conversation

@aaronstevenwhite

Copy link
Copy Markdown
Collaborator

Summary

Fixes all three open issues, found while mapping these resources into downstream consumers. Each is an independent converter-correctness bug with new regression tests.

fix(wordnet)lex_filenamelex_filenum mismatch (#9)

LEX_FILE_NAMES was mis-ordered: adv.all/adj.ppl were misplaced and every entry from index 2 onward was shifted by one. So lex_filenum=29 (canonically verb.body) was labeled noun.time, and lex_filenum=3 (noun.Tops) was labeled adv.all. The table is now aligned to the canonical WordNet lexnames lexicographer-file table.

fix(wordnet) — adjective syntactic-position markers (#8)

WordNet appends (p)/(a)/(ip) markers directly onto adjective word tokens (e.g. galore(ip)). The marker stayed on the lemma, failed lemma validation, and the entire synset was silently dropped during conversion — so this was data loss, not just a missing field. The marker is now parsed off into a new optional Word.syntactic_marker field (additive, backward-compatible), and the synset is retained.

fix(framenet)requiresFE/excludesFE empty (#7)

requiresFE/excludesFE are self-closing siblings of <FE> whose target FE name lives in the name attribute. The converter used find() to grab the first such element and then iterated its (nonexistent) child elements, so requires_fe/excludes_fe were always empty (0 of 11,428 FEs). It now uses findall() and reads the name attribute from each sibling. Verified against the real FN 1.7 Personal_relationship frame.

ci(release) — harden the PyPI release workflow

Per request: added a twine check gate, linked the pypi environment to the project URL, and added a GitHub Release step (which also gives Zenodo a release to archive) after a successful publish. Still OIDC trusted publishing gated by the pypi environment — no API tokens.

Version

Patch bump 0.2.2 → 0.2.3 (CHANGELOG + docs updated). The only API change is the additive optional Word.syntactic_marker field.

Testing

Full CI suite run locally and green: ruff check, ruff format --check, mypy --strict src/ (no ignores added), pytest (1395 passed), clean-venv minimal install, integration CLI + sample conversion, and python -m build + twine check. New tests cover all three fixes, including regression cases for the previously-dropped marker synsets and the canonical lexnames table.

Closes #7
Closes #8
Closes #9

…markers

Two independent WordNet converter bugs surfaced while mapping WordNet into
downstream consumers:

- lex_filename was derived from a mis-ordered table: adv.all and adj.ppl were
  misplaced and every entry from index 2 onward was shifted by one, so e.g.
  lex_filenum=29 (verb.body) was labeled noun.time and lex_filenum=3
  (noun.Tops) was labeled adv.all. Align LEX_FILE_NAMES with the canonical
  WordNet lexnames lexicographer-file table.
- Adjective syntactic-position markers ((p)/(a)/(ip)) were left appended to
  the word token, which failed lemma validation and caused the entire synset
  to be silently dropped. Parse the marker off the word into the new
  Word.syntactic_marker field instead.

Closes #9
Closes #8
requiresFE/excludesFE are self-closing siblings of <FE> whose target FE name
lives in the name attribute. The converter used find() to grab the first such
element and then iterated its (nonexistent) child elements, so requires_fe and
excludes_fe were always empty. Use findall() and read the name attribute from
each sibling.

Closes #7
Add a twine check gate, link the pypi environment to the project URL, and
create a matching GitHub Release (which also gives Zenodo a release to
archive) after a successful publish. Publishing still uses OIDC trusted
publishing gated by the pypi environment; no API tokens are stored.
Patch release covering the WordNet and FrameNet converter fixes (#7, #8, #9).
The new Word.syntactic_marker field is an additive, backward-compatible
optional field.
mypy 2.x narrows dataset_lower to DatasetType after the membership guard, so
the subsequent cast became a redundant-cast error under --strict. Fold the
cast into the lookup on the still-unnarrowed str and use dict.get, which keeps
the cast genuinely needed (so it passes mypy 1.x and 2.x) without changing
behavior: unsupported names still raise ValueError.
The unpinned `mypy>=1.8.0` dev spec let CI resolve a newer mypy (2.x) than
local environments, whose stricter `--strict` analysis failed Type Check on
code that passed locally. Pin the exact version so CI and local runs agree;
bump deliberately.
@aaronstevenwhite
aaronstevenwhite merged commit 188332c into main Jun 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant