🚀 [Feature]: Query Norwegian law offline and parse the archives into objects - #20
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…pell check The metadata parser now normalises irregular whitespace read from the archive so the bundled index carries no non-breaking spaces, which the strict JSON linter rejects. The spell checker skips the generated index files and the Norwegian test fixtures. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…nology linter Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Read each LastChangedBy reference date from that reference's own RefID rather than from the field as a whole, and add InForceFrom for the per-reference 'fra <date>' in-force qualifier. Previously one date was computed for the whole field and stamped on every reference, mislabelling every reference after the first and dropping the in-force date entirely. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Assert the real two-reference shape from a small NLOD fixture: each reference keeps its own date, and the first reference's 'fra' in-force date does not leak onto the second reference that has none. This is the exact failure mode that slipped through before, because no test covered more than one reference. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Rebuild the index so LastChangedBy references carry their own correct dates and the new InForceFrom field. The committed data previously shipped a neighbour's date on every reference after the first. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Note that the skip silences the Norwegian legal data on purpose and that the trade-off is a real typo in a future fixture going uncaught. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
codespell reads the bare local 'inForce' as a misspelling of 'enforce'. Rename it to inForceFrom to match the property; the index output is unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Verified independently before merge, against the committed index rather than the parser tests. Corpus-wide invariant across the bundled data: for every reference whose RefID embeds a date, does Independent spot-check against published text: veglova's record is
The regression test asserts per reference including the negative case, so it fails against the previous parser rather than merely passing against the new one. First-query cost is deferred to #21 as a measured, non-blocking characteristic. |
7b2ee34
into
build-lovdata-module
Norwegian acts and central regulations are now reachable as PowerShell objects, offline and with no account. The module ships a bundled index of every openly published document's metadata, refreshed daily, and can parse a downloaded archive into a full object hierarchy, preserving chapter and paragraph structure, clauses, lists, footnotes, and change notes, with nothing dropped.
New: Search the whole corpus offline
Find-LovdataDocumentsearches the bundled index by title, short title, identifier, ministry, or legal area, andGet-LovdataDocumentreturns a document from the index with no network access.Get-LovdataLegalAreareturns the legal-area taxonomy derived from the index.New: Full-fidelity documents from an archive
Expand-LovdataPublicDatasetunpacks a downloaded.tar.bz2package, andGet-LovdataDocument -Pathparses the extracted XML into aLovdataDocumentwith its complete body. A date field carrying two dates or a prose qualifier is exposed in full rather than truncated, and a legal area keeps its hierarchical path.Technical Details
src/classes/public/derived from a scan of the live corpus.src/functions/private/Parsing/.src/, generated by the module's own parser, refreshed byscripts/Update-LovdataData.ps1and a daily workflow.Related issues