Skip to content

fix: normalize VerbNet resource name case in xref extractor - #14

Open
abhi-0203 wants to merge 1 commit into
FACTSlab:mainfrom
abhi-0203:fix/verbnet-case-sensitivity
Open

fix: normalize VerbNet resource name case in xref extractor#14
abhi-0203 wants to merge 1 commit into
FACTSlab:mainfrom
abhi-0203:fix/verbnet-case-sensitivity

Conversation

@abhi-0203

Copy link
Copy Markdown

Summary

Fixes ValueError: Unknown lexlink resource type: VerbNet (and the symmetric rolelink error) in xref extract.

PropBank frame files overwhelmingly use the capitalized form "VerbNet" (39,821 occurrences vs 4 lowercase), but the extractor only matched lowercase "verbnet". This causes xref extract to abort on standard SemLink-annotated PropBank frames.

Root Cause

In _index_propbank_mappings, both the lexlink and rolelink branches compare against lowercase "verbnet" only, while src/glazing/types.py explicitly lists "VerbNet" (capitalized) as a valid ResourceType. The FrameNet branch already handles multiple capitalization variants ("FrameNet", "Framenet"), but VerbNet did not get the same treatment.

Fix

Use .lower() == "verbnet" for case-insensitive comparison in both the lexlink and rolelink branches, consistent with how the codebase normalizes resource names. Also add "framenet" (lowercase) to the FrameNet variant list for completeness.

Verification

# Before: raises ValueError
# After: correctly normalizes "VerbNet" → "verbnet"
assert "VerbNet".lower() == "verbnet"  # ✓
assert "verbnet".lower() == "verbnet"  # ✓

Closes #13

PropBank frame files use capitalized "VerbNet" (39821 occurrences)
but the extractor only matched lowercase "verbnet", causing
ValueError on valid input. Use case-insensitive comparison for
VerbNet, consistent with how FrameNet variants are already handled.

Closes FACTSlab#13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xref extract: ValueError on capitalized "VerbNet" lex/rolelink resource (only lowercase handled)

1 participant