Open
Conversation
Implements selex:upphavd_av attribute to link repealed sections to their repealing ändringsförfattning. This resolves the TODO at format_sfs_text.py:718. Changes: - Add temporal/parse_anteckningar.py: Parser for Swedish amendment notes (anteckningar) that extracts repealed, amended, and new paragraphs - Modify sfs_processor.py: Build repeal_map from andringsforfattningar and pass to formatter - Modify formatters/format_sfs_text.py: Add selex:upphavd_av attribute to repealed sections with helper function for ID normalization - Add comprehensive test coverage: 27 parser tests + 8 integration tests Example output: <section selex:status="upphavd" selex:upphavd_av="2015:73"> All 68 tests passing. Validated with real data from 2010:800.json. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the
selex:upphavd_avattribute to track which ändringsförfattning repealed each section. This resolves the TODO comment atformatters/format_sfs_text.py:718.Changes
New files:
temporal/parse_anteckningar.py- Parser for Swedish amendment notes (anteckningar)upph.), amended (ändr.), and new (ny/nya) paragraphsupph. 29 kap. 15, 16 §§test/test_parse_anteckningar.py- Comprehensive test suite (27 tests)Modified files:
sfs_processor.py- Build repeal_map from andringsforfattningar and pass to formatterformatters/format_sfs_text.py- Addselex:upphavd_avattribute with ID normalizationtest/test_format_sfs_text.py- Integration tests for repeal_map functionality (8 tests)Example Output
Before:
After:
Testing
2010:800.jsonScope
Phase 1 (this PR):
upph. 15 §,upph. 29 kap. 15 §upph. 29 kap. 15, 16 §§upph. 29 kap. 22 a §Phase 2 (future):
upph. 23 kap.betecknas🤖 Generated with Claude Code