Merged
Conversation
This commit adds support for classifying SFS documents by their legal type (normtyp) with three categories: Grundlag, Lag, and Förordning. Changes: - Add util/normtyp_utils.py with determine_normtyp() function - Identify Sweden's four fundamental laws (grundlagar) by SFS number - Integrate normtyp into markdown frontmatter generation - Add normtyp to HTML export metadata display - Update frontmatter property ordering to include normtyp The normtyp field appears after departement in frontmatter and is determined by checking if the document is a grundlag, then using the forfattningstypNamn field from source data to distinguish between regular laws and regulations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed from Swedish "normtyp" to English "doctype" for better consistency in filenames, variable names, and frontmatter keys. Changes: - Rename util/normtyp_utils.py to util/doctype_utils.py - Rename determine_normtyp() to determine_doctype() - Update frontmatter key from "normtyp" to "doctype" - Update HTML metadata label from "Normtyp" to "Doctype" - Update all imports and references throughout codebase The field values remain in Swedish (Grundlag, Lag, Förordning) as these are the official Swedish legal terms. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
While internal code uses 'doctype' for clarity, the frontmatter key and HTML display should use the Swedish term 'normtyp' to match Swedish legal terminology and user expectations. Changes: - Frontmatter key: doctype → normtyp - HTML display label: "Doctype" → "Normtyp" - Property sort order: normtyp positioned before departement Internal code (functions, variables) continues to use 'doctype'. 🤖 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
This PR adds support for classifying SFS documents by their legal type (doctype) with three categories:
Changes
util/doctype_utils.pywithdetermine_doctype()functionImplementation Details
The doctype is determined by:
forfattningstypNamnfield from source dataField key uses English ("doctype") while values remain in Swedish (Grundlag, Lag, Förordning) as these are the official Swedish legal terms.
Test Results
doctype: Grundlagdoctype: Lagdoctype: Förordning🤖 Generated with Claude Code