Repository navigation
Parser for references to German law and GEP 11 enforcement - #1265
Draft
MImmesberger wants to merge 13 commits into
Draft
MImmesberger wants to merge 13 commits into
MImmesberger wants to merge 13 commits into
Conversation
Add laws.yaml, a parser that wraps bundesrecht for the provision and parses the act itself, pass it to TTSIM in gettsim.main, and test that all policy functions, RoundingSpecs and date entries of parameters carry valid references.
for more information, see https://pre-commit.ci
…im-dev/gettsim into claude/project-thread-y388yx
1 task
Provisions follow the small grammar of GEP 11, so we parse them directly. This also allows citing a provision of an act without an official abbreviation, e.g. § 1 Abs. 1 V. v. 05.06.1992 BGBl. I S. 1017, and keeps Nr. 14a apart from Nr. 14 Buchst. a.
GEP 11 now explains which abbreviation to use, when to cite idF and when to cite the act that contains the provision, also for amended acts.
for more information, see https://pre-commit.ci
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.
What problem do you want to solve?
Step 2 of the implementation of GEP 11 (#1264). Stacked on the GEP branch; requires ttsim-dev/ttsim#167. The conversion of all references follows in a single PR on top of this one (#1266), and both are merged together. Until then, the enforcement tests fail by design.
gettsim.legal_references:GermanLegalReferenceParser, which implements TTSIM'sLegalReferenceParserprotocol. It parses the grammar of GEP 11 itself; no external parser is used.§ n[a-z]followed by Abs., Satz (orS.), Halbsatz, Nr., Buchst., Doppelbuchst. in the order in which the law nests them.Nr. 14ais a Nummer of its own and differs fromNr. 14 Buchst. a.laws.yaml(§ 66 Abs. 1 EStG idF <act>) or to an act without an official abbreviation, which is cited by its publication (§ 3 Abs. 1 Nr. 1 V. v. 02.12.2011 BGBl. I S. 2421, or... idF <amending act>if it was amended).[Art. n [Nr. n]] G.|V.|B. v. DD.MM.YYYY BGBl. I S. nuntil 2022,BGBl. YYYY I Nr. nfrom 2023 on.ff.,und,i.V.m.), and a known law.§66 Estg,§ 66 (1) EStG,Absatz,Nummer,lit.,Hs.,SGB 2,i.d.F., a bare act). An unknown law lists the closest abbreviations.matches: a query matches the provision and its parts, and a less precise reference covers its parts. The act only counts if it is in the query, and an act without an article matches all of its articles.laws.yamllists the laws GETTSIM cites today by their abbreviation on gesetze-im-internet.de. The conversion PR extends it.gettsim.mainpasses the parser by default and gainslegal_references_parserandlegal_references_query.tests_germany/test_legal_references.py:idF, and when to cite the act itself.ttsim-backendpoints to the TTSIM branch for now.Todo
ttsim-backendback to a release once Add references to the law of policy objects (GEP 11) ttsim#167 is released.