@tricoteuses/tisseuse 0.12.9 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -0
- package/dist/index.js +143 -1397
- package/dist/server.js +2739 -158
- package/dist/src/lib/extractors/action_directives.d.ts +84 -22
- package/dist/src/lib/extractors/article_portions.d.ts +15 -1
- package/dist/src/lib/extractors/references.d.ts +3 -1
- package/dist/src/lib/extractors/table_of_contents.d.ts +2 -0
- package/dist/src/lib/f_legi/extractors/links.d.ts +134 -0
- package/dist/src/lib/f_legi/linkers/html.d.ts +51 -0
- package/dist/src/lib/f_legi/resolver.d.ts +54 -0
- package/dist/src/lib/index.d.ts +4 -3
- package/dist/src/lib/legi/canutes_resolver.d.ts +33 -0
- package/dist/src/lib/legi/resolver.d.ts +48 -0
- package/dist/src/lib/server/databases/index.d.ts +1 -1
- package/dist/src/lib/server/f_legi/databases/index.d.ts +2 -0
- package/dist/src/lib/server/f_legi/linkers/html.d.ts +20 -0
- package/dist/src/lib/server/index.d.ts +3 -0
- package/dist/src/lib/server/legi/resolvers.d.ts +10 -0
- package/dist/src/lib/server/parsed_bills.d.ts +105 -0
- package/dist/src/lib/server/parsed_bills.test.d.ts +1 -0
- package/dist/src/lib/test/text_titles_infos.d.ts +1 -0
- package/dist/src/lib/text_parsers/action_directives.d.ts +3 -0
- package/dist/src/lib/text_parsers/action_directives.test.d.ts +1 -0
- package/dist/src/lib/text_parsers/ast.d.ts +53 -1
- package/dist/src/lib/text_parsers/parsers.d.ts +2 -0
- package/dist/src/lib/text_parsers/texts.d.ts +1 -0
- package/dist/src/lib/timings.d.ts +19 -0
- package/dist/src/scripts/f_legi/add_links_to_html_document.d.ts +0 -0
- package/dist/src/scripts/parse_akoma_ntoso_bill_raw.d.ts +1 -0
- package/dist/src/scripts/parse_assemblee_bill_raw.d.ts +1 -0
- package/dist/{html-D3MxsPeu.js → textes-8dVwaLo9.js} +5162 -3076
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -38,3 +38,49 @@ Create a `.env` file to set configuration variables (you can use `example.env` a
|
|
|
38
38
|
```sh
|
|
39
39
|
npm run configure
|
|
40
40
|
```
|
|
41
|
+
|
|
42
|
+
## Legal reference resolver
|
|
43
|
+
|
|
44
|
+
Tisseuse resolves legal references through a `LegiResolver`. The default
|
|
45
|
+
resolver is `canutes`, which uses the configured Canutes database and a generated
|
|
46
|
+
`text_titles_infos.json` file.
|
|
47
|
+
|
|
48
|
+
There are two supported resolver paths for tests and scripts:
|
|
49
|
+
|
|
50
|
+
- `f_legi`: uses the flat f_legi database and does not need a generated
|
|
51
|
+
`text_titles_infos.json` file.
|
|
52
|
+
- `canutes`: uses the Canutes database and requires generating
|
|
53
|
+
`src/lib/text_parsers/text_titles_infos.json` before running tests that parse
|
|
54
|
+
or resolve French text titles.
|
|
55
|
+
|
|
56
|
+
Use `f_legi` explicitly when you want to run against the flat f_legi database:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
TISSEUSE_LEGI_RESOLVER=f_legi npm test
|
|
60
|
+
npx tsx src/scripts/parse_assemblee_bill_raw.ts bill.html.raw --resolver f_legi
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
For the default Canutes resolver, generate the text title index first, then run
|
|
64
|
+
the tests:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
npx tsx src/scripts/extract_texts_titles_infos.ts
|
|
68
|
+
npm test
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
This creates `src/lib/text_parsers/text_titles_infos.json`. It is generated from
|
|
72
|
+
the Canutes database, is listed in `.gitignore`, and must never be committed.
|
|
73
|
+
|
|
74
|
+
If you need to keep the generated file outside the working tree, pass it through
|
|
75
|
+
`TISSEUSE_TEXT_TITLES_INFOS_PATH` or script options instead:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
TISSEUSE_TEXT_TITLES_INFOS_PATH=/path/to/text_titles_infos.json npm test
|
|
79
|
+
npx tsx src/scripts/parse_akoma_ntoso_bill_raw.ts bill.akn.xml.raw --text-titles-infos /path/to/text_titles_infos.json
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
If no path is supplied, the Canutes resolver first tries
|
|
83
|
+
`src/lib/text_parsers/text_titles_infos.json` from the current working tree, then
|
|
84
|
+
the same generated file in the local tisseuse package source tree. That file is
|
|
85
|
+
generated data and is not loaded through Vitest global setup; tests that need it
|
|
86
|
+
preload it explicitly through the selected resolver.
|