clean up repo
All checks were successful
CI/CD Pipeline / test (push) Successful in 2m25s

This commit is contained in:
philipp 2024-02-06 11:30:28 +01:00
parent 1933b47e46
commit 94a52b94dc

View File

@ -1,76 +1,40 @@
RISolve
# Folder
- ./data
- cache -> cache for `overview` tests
- expected
- overview -> expected xml links of law_ids
# Add new law text # Add new law text
## Tests ## Tests
- Getting paragraphs from `law_id` (`risparser::overview::test::parse()`) - Getting paragraphs from `law_id` (`risparser::overview::test::parse()`)
- Create file `law_id` in `./data/expected/overview` (then run tests to get current output + save in file) - Create file `law_id` in `./data/expected/overview` (then run tests to get current output + save in file)
- Parsing paragraphs: add test in `src/risparser/paragraph/mod.rs` - Create config file in `./data/configs/`
-
# Features (to be moved to lib.rs one-by-one)
- Text to structured law
- `LawBuilder`: Structure law, by specifying (sub-)sections (`new_header`), its description (`new_desc`), paragraphs under the current (sub-)section (`new_par`), and the description of the next paragraph (`new_next_para_header`). `Classifier` need to be set.
- Main output: Properly structured laws (`Law`)
- `Law`: Represents a structured law text. Can be generated with `LawBuilder`.
- Main output: properly formatted (md for a start) law text, no need to export Heading/... etc
- RIS Fetcher (to be mocked)
- all paragraphs of specific law (`overview`)
- xml document from url (`par/mod.rs fetch_age`)
- Parser
- replace errors w/ config file
# Integration test # Integration test
- Nice test would be to re-create html ris file and compare it (problem with custom fixes, though) - Nice test would be to re-create html ris file and compare it (problem with custom fixes, though)
# History
- [I've created my first parser using RIS API, daily updated. Failed because I tried to do too much automatically (e.g. recognizing headers](https://gitlab.com/PhilippHofer/law)
- [Using print-website, I've extracted stuff w/ regex.](https://gitlab.com/PhilippHofer/ris/)
- [Tried to create a parser using print-website, proper(-ish) parser](https://gitlab.com/PhilippHofer/ris2)
# Goals # Goals
- [x] I want to have the text of the law. - [x] I want to have the text of the law.
- [x] I want to see the structure (proper headers) of the law. - [x] I want to see the structure (proper headers) of the law.
- [ ] I want to be able to make comments (e.g. Erschöpfung) on certain parts - [ ] I want to be able to make comments (e.g. Erschöpfung) on certain parts
- [ ] I want to see since when this paragraph is in use. - [ ] I want to see since when this paragraph is in use.
- [~] Lawtext should be updateable - [.] Lawtext should be updateable
# Technical # Mindset
- I don't want to restrict myself with a [parser combinators](docs.rs/nom) but code it myself using *recursive descent* parser. - I don't want to restrict myself with a [parser combinators](docs.rs/nom) but code it myself using *recursive descent* parser.
- Be strict in what I process. Fail if anything unexpected happens. The user should handle this case. It's fine if one decides to ignore the new/unexpected field, but it should be done deliberately. - Be strict in what I process. Fail if anything unexpected happens. The user should handle this case. It's fine if one decides to ignore the new/unexpected field, but it should be done deliberately.
# Progress / Functions # Nomenclature
- [x] Parse structure of law into struct using Deserilize trait, pot. multiple requests (if > 100 paragraphs)
- [x] Parse risdok using own *RD parser*, again strict: fail if anything not expected happens, not sure (yet) if I want to operate on strings, or first parse using off-the-shelve XML reader (prob. 2nd option)
# Next step
- [x] Parse ABGB
- [ ] Create config files for laws
- law_id
- replace stuff
- headers
- [ ] Create argument parse
- `--law mschg.conf`
# Naming
- Law ("Gesetz"): e.g. UHG, TEG, ABGB - Law ("Gesetz"): e.g. UHG, TEG, ABGB
- Section ("Paragraph") - Section ("Paragraph")
- Subsection ("Absatz") - Subsection ("Absatz")
- Item ("Ziffer") - Item ("Ziffer")
- Heading-{1,2,3,...} - Heading-{1,2,3,...}
# "Scripts"
- Retrieve overview law: `curl -X POST "https://data.bka.gv.at/ris/api/v2.6/Bundesrecht" -H "Content-Type: application/x-www-form-urlencoded" -d "Applikation=BrKons" -d "Gesetzesnummer=10001899" -d "DokumenteProSeite=OneHundred" -d "Seitennummer=1" -d "Fassung.FassungVom=2023-11-03" | jq . > law.json`
# Folder-Structure of this repo
- ./data
- cache -> cache for `overview` tests
- expected
- overview -> expected xml links of law_ids
# History
- [I've created my first parser using RIS API, daily updated. Failed because I tried to do too much automatically (e.g. recognizing headers](https://gitlab.com/PhilippHofer/law)
- [Using print-website, I've extracted stuff w/ regex.](https://gitlab.com/PhilippHofer/ris/)
- [Tried to create a parser using print-website, proper(-ish) parser](https://gitlab.com/PhilippHofer/ris2)