@littlebigbrain/create 0.1.0 → 0.3.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.
Files changed (56) hide show
  1. package/README.md +6 -2
  2. package/lib/create.mjs +33 -5
  3. package/package.json +1 -1
  4. package/templates/_shared/testing.ts +53 -9
  5. package/templates/documents-link/README.md +9 -7
  6. package/templates/documents-link/workflow.test.ts +28 -1
  7. package/templates/documents-link/workflow.ts +24 -14
  8. package/templates/documents-map/README.md +212 -0
  9. package/templates/documents-map/map.ts +1135 -0
  10. package/templates/documents-map/samples/ausstattungsliste.pdf +76 -0
  11. package/templates/documents-map/samples/baubeschreibung.pdf +54 -0
  12. package/templates/documents-map/samples/expected.json +50 -0
  13. package/templates/documents-map/samples/pages/raumblaetter.json +1580 -0
  14. package/templates/documents-map/samples/raumblaetter.pdf +109 -0
  15. package/templates/documents-map/samples/trace.json +613 -0
  16. package/templates/documents-map/samples.ts +182 -0
  17. package/templates/documents-map/workflow.test.ts +770 -0
  18. package/templates/documents-map/workflow.ts +1199 -0
  19. package/templates/link/README.md +203 -0
  20. package/templates/link/candidates.ts +432 -0
  21. package/templates/link/decide.test.ts +368 -0
  22. package/templates/link/decide.ts +340 -0
  23. package/templates/link/fixture.ts +727 -0
  24. package/templates/link/grade-run.ts +53 -0
  25. package/templates/link/grade.test.ts +113 -0
  26. package/templates/link/grade.ts +335 -0
  27. package/templates/link/items.ts +333 -0
  28. package/templates/link/names.test.ts +260 -0
  29. package/templates/link/names.ts +590 -0
  30. package/templates/link/reads.ts +302 -0
  31. package/templates/link/samples/gold.json +108 -0
  32. package/templates/link/samples/records.json +48 -0
  33. package/templates/link/samples.ts +64 -0
  34. package/templates/link/settings.ts +162 -0
  35. package/templates/link/setup.ts +18 -0
  36. package/templates/link/source-turn.ts +894 -0
  37. package/templates/link/sources/records.ts +429 -0
  38. package/templates/link/things-turn.ts +984 -0
  39. package/templates/link/things.test.ts +204 -0
  40. package/templates/link/things.ts +426 -0
  41. package/templates/link/try.ts +28 -0
  42. package/templates/link/worker.ts +24 -0
  43. package/templates/link/workflow.test.ts +484 -0
  44. package/templates/link/workflow.ts +202 -0
  45. package/templates/ontology-fit/workflow.test.ts +7 -1
  46. package/templates/ontology-fit/workflow.ts +5 -2
  47. package/templates/review/README.md +158 -0
  48. package/templates/review/decision.ts +483 -0
  49. package/templates/review/samples/expected.json +37 -0
  50. package/templates/review/samples/proposals.json +35 -0
  51. package/templates/review/samples.ts +154 -0
  52. package/templates/review/workflow.test.ts +438 -0
  53. package/templates/review/workflow.ts +459 -0
  54. package/templates/values-extract/workflow.test.ts +24 -1
  55. package/templates/values-extract/workflow.ts +11 -3
  56. package/templates/versions.json +1 -1
@@ -0,0 +1,613 @@
1
+ {
2
+ "about": [
3
+ "The input of documents-map: what a correct documents-link run writes on the three sample PDFs, with the roles and the answer key of documents-link/samples/expected.json. Written by sdk/templates/_samples/make-trace.mjs; do not edit by hand.",
4
+ "page is 0-based, as the graph holds it. box is [x0, y0, x1, y1], normalized to the page: the line of an entry, the span of a mention.",
5
+ "A link confidence is invented, as a link run gives it: 0.96 for a code as the list writes it, 0.9 for another spelling, 0.92 for a section of the specification. A mention with link null has no link."
6
+ ],
7
+ "documents": [
8
+ {
9
+ "name": "ausstattungsliste.pdf",
10
+ "sha256": "94c0d4143685b6a810cef7ffb51319b7c3b0bd85ec34e26b349484fc2eda612f",
11
+ "pages": 1
12
+ },
13
+ {
14
+ "name": "baubeschreibung.pdf",
15
+ "sha256": "ad840886f5b9f53c9670dbace9a12422ab3d6d93f3c8b3e774f2ad3fb914f43f",
16
+ "pages": 1
17
+ },
18
+ {
19
+ "name": "raumblaetter.pdf",
20
+ "sha256": "59e841396e003a2c5290f93c3a5b4fb859bd1b72df9783db1832f347a00a2cc3",
21
+ "pages": 2
22
+ }
23
+ ],
24
+ "entries": [
25
+ {
26
+ "document": "ausstattungsliste.pdf",
27
+ "identifier": "S 1.1",
28
+ "context": "S 1.1 Waschtisch, Keramik, ca. 55x45 cm, mit Einhebelmischer",
29
+ "line_id": "p1-l6",
30
+ "page": 0,
31
+ "box": [
32
+ 0.121,
33
+ 0.1898,
34
+ 0.5972,
35
+ 0.2008
36
+ ]
37
+ },
38
+ {
39
+ "document": "ausstattungsliste.pdf",
40
+ "identifier": "S 1.2",
41
+ "context": "S 1.2 WC, wandhängend, mit Unterputz-Spülkasten",
42
+ "line_id": "p1-l7",
43
+ "page": 0,
44
+ "box": [
45
+ 0.121,
46
+ 0.2076,
47
+ 0.5113,
48
+ 0.2186
49
+ ]
50
+ },
51
+ {
52
+ "document": "ausstattungsliste.pdf",
53
+ "identifier": "S 1.3",
54
+ "context": "S 1.3 Urinal, Keramik, mit Spülsteuerung",
55
+ "line_id": "p1-l8",
56
+ "page": 0,
57
+ "box": [
58
+ 0.121,
59
+ 0.2254,
60
+ 0.43,
61
+ 0.2364
62
+ ]
63
+ },
64
+ {
65
+ "document": "ausstattungsliste.pdf",
66
+ "identifier": "S 2.1",
67
+ "context": "S 2.1 Spiegel, Kristallglas, 60x45 cm",
68
+ "line_id": "p1-l9",
69
+ "page": 0,
70
+ "box": [
71
+ 0.121,
72
+ 0.2433,
73
+ 0.3992,
74
+ 0.2542
75
+ ]
76
+ },
77
+ {
78
+ "document": "ausstattungsliste.pdf",
79
+ "identifier": "S 2.2",
80
+ "context": "S 2.2 Seifenspender, Edelstahl, 0,5 l Möbel",
81
+ "line_id": "p1-l10",
82
+ "page": 0,
83
+ "box": [
84
+ 0.121,
85
+ 0.2611,
86
+ 0.3983,
87
+ 0.2721
88
+ ]
89
+ },
90
+ {
91
+ "document": "ausstattungsliste.pdf",
92
+ "identifier": "T 1",
93
+ "context": "T 1 Einzeltisch, 70x50 cm, höhenverstellbar",
94
+ "line_id": "p1-l12",
95
+ "page": 0,
96
+ "box": [
97
+ 0.136,
98
+ 0.3038,
99
+ 0.4664,
100
+ 0.3148
101
+ ]
102
+ },
103
+ {
104
+ "document": "ausstattungsliste.pdf",
105
+ "identifier": "T 2",
106
+ "context": "T 2 Lehrertisch, 140x70 cm",
107
+ "line_id": "p1-l13",
108
+ "page": 0,
109
+ "box": [
110
+ 0.136,
111
+ 0.3216,
112
+ 0.345,
113
+ 0.3326
114
+ ]
115
+ },
116
+ {
117
+ "document": "ausstattungsliste.pdf",
118
+ "identifier": "T 3",
119
+ "context": "T 3 Schülerstuhl, Kunststoff, Größe 5 Leuchten",
120
+ "line_id": "p1-l14",
121
+ "page": 0,
122
+ "box": [
123
+ 0.136,
124
+ 0.3395,
125
+ 0.4179,
126
+ 0.3504
127
+ ]
128
+ },
129
+ {
130
+ "document": "ausstattungsliste.pdf",
131
+ "identifier": "L 1",
132
+ "context": "L 1 Wandleuchte LED, 12 W",
133
+ "line_id": "p1-l16",
134
+ "page": 0,
135
+ "box": [
136
+ 0.1369,
137
+ 0.3822,
138
+ 0.3544,
139
+ 0.3932
140
+ ]
141
+ },
142
+ {
143
+ "document": "ausstattungsliste.pdf",
144
+ "identifier": "L 2",
145
+ "context": "L 2 Deckenleuchte LED, 36 W, dimmbar",
146
+ "line_id": "p1-l17",
147
+ "page": 0,
148
+ "box": [
149
+ 0.1369,
150
+ 0.4,
151
+ 0.4421,
152
+ 0.411
153
+ ]
154
+ },
155
+ {
156
+ "document": "ausstattungsliste.pdf",
157
+ "identifier": "L 3",
158
+ "context": "L 3 Sicherheitsleuchte mit Einzelbatterie Tafeln",
159
+ "line_id": "p1-l18",
160
+ "page": 0,
161
+ "box": [
162
+ 0.1369,
163
+ 0.4178,
164
+ 0.4412,
165
+ 0.4288
166
+ ]
167
+ },
168
+ {
169
+ "document": "ausstattungsliste.pdf",
170
+ "identifier": "W 1",
171
+ "context": "W 1 Wandtafel, Klapptafel, 200x100 cm Seite 1 von 1",
172
+ "line_id": "p1-l20",
173
+ "page": 0,
174
+ "box": [
175
+ 0.1304,
176
+ 0.4606,
177
+ 0.431,
178
+ 0.4716
179
+ ]
180
+ },
181
+ {
182
+ "document": "baubeschreibung.pdf",
183
+ "identifier": "3.1",
184
+ "context": "3.1 Bodenbeläge Klassenräume und Flure erhalten Linoleum, 2,5 mm, vollflächig auf schwimmendem Estrich geklebt. Sanitärräume erhalten rutschhemmende Bodenfliesen aus Feinsteinzeug.",
185
+ "line_id": "p1-l4",
186
+ "page": 0,
187
+ "box": [
188
+ 0.121,
189
+ 0.1498,
190
+ 0.2679,
191
+ 0.1618
192
+ ]
193
+ },
194
+ {
195
+ "document": "baubeschreibung.pdf",
196
+ "identifier": "3.2",
197
+ "context": "3.2 Sanitärobjekte Waschtische, WCs und Urinale sind aus weißer Sanitärkeramik, die Armaturen sind wassersparend. Die einzelnen Objekte nennt die Ausstattungsliste.",
198
+ "line_id": "p1-l7",
199
+ "page": 0,
200
+ "box": [
201
+ 0.121,
202
+ 0.2139,
203
+ 0.2792,
204
+ 0.226
205
+ ]
206
+ },
207
+ {
208
+ "document": "baubeschreibung.pdf",
209
+ "identifier": "3.3",
210
+ "context": "3.3 Beleuchtung Alle Räume erhalten LED-Leuchten. Die Leuchten der Klassenräume sind tageslichtabhängig dimmbar, Flure und Treppen erhalten Sicherheitsleuchten mit Einzelbatterie. Seite 1 von 1",
211
+ "line_id": "p1-l10",
212
+ "page": 0,
213
+ "box": [
214
+ 0.121,
215
+ 0.278,
216
+ 0.2638,
217
+ 0.2901
218
+ ]
219
+ }
220
+ ],
221
+ "mentions": [
222
+ {
223
+ "document": "raumblaetter.pdf",
224
+ "span": "0.12",
225
+ "kind": "own_number",
226
+ "line_id": "p1-l2",
227
+ "line_text": "Raum 0.12 Klassenraum",
228
+ "page": 0,
229
+ "box": [
230
+ 0.2032,
231
+ 0.0837,
232
+ 0.2555,
233
+ 0.1013
234
+ ],
235
+ "link": null
236
+ },
237
+ {
238
+ "document": "raumblaetter.pdf",
239
+ "span": "3,00 m",
240
+ "kind": "value",
241
+ "line_id": "p1-l5",
242
+ "line_text": "Lichte Raumhöhe 3,00 m",
243
+ "page": 0,
244
+ "box": [
245
+ 0.2628,
246
+ 0.1554,
247
+ 0.3142,
248
+ 0.1664
249
+ ],
250
+ "link": null
251
+ },
252
+ {
253
+ "document": "raumblaetter.pdf",
254
+ "span": "3.1",
255
+ "kind": "identifier",
256
+ "line_id": "p1-l6",
257
+ "line_text": "Bodenbelag Linoleum, siehe Baubeschreibung Kap. 3.1",
258
+ "page": 0,
259
+ "box": [
260
+ 0.5599,
261
+ 0.1732,
262
+ 0.5832,
263
+ 0.1842
264
+ ],
265
+ "link": {
266
+ "relation": "REFERS_TO",
267
+ "document": "baubeschreibung.pdf",
268
+ "identifier": "3.1",
269
+ "confidence": 0.92
270
+ }
271
+ },
272
+ {
273
+ "document": "raumblaetter.pdf",
274
+ "span": "T1",
275
+ "kind": "identifier",
276
+ "line_id": "p1-l8",
277
+ "line_text": "T1 Einzeltisch, 28 Stück",
278
+ "page": 0,
279
+ "box": [
280
+ 0.1369,
281
+ 0.2385,
282
+ 0.1565,
283
+ 0.2495
284
+ ],
285
+ "link": {
286
+ "relation": "REFERS_TO",
287
+ "document": "ausstattungsliste.pdf",
288
+ "identifier": "T 1",
289
+ "confidence": 0.9
290
+ }
291
+ },
292
+ {
293
+ "document": "raumblaetter.pdf",
294
+ "span": "T 3",
295
+ "kind": "identifier",
296
+ "line_id": "p1-l9",
297
+ "line_text": "T 3 Schülerstuhl, 28 Stück",
298
+ "page": 0,
299
+ "box": [
300
+ 0.1322,
301
+ 0.2563,
302
+ 0.1565,
303
+ 0.2673
304
+ ],
305
+ "link": {
306
+ "relation": "REFERS_TO",
307
+ "document": "ausstattungsliste.pdf",
308
+ "identifier": "T 3",
309
+ "confidence": 0.96
310
+ }
311
+ },
312
+ {
313
+ "document": "raumblaetter.pdf",
314
+ "span": "T 2",
315
+ "kind": "identifier",
316
+ "line_id": "p1-l10",
317
+ "line_text": "T 2 Lehrertisch, 1 Stück",
318
+ "page": 0,
319
+ "box": [
320
+ 0.1322,
321
+ 0.2741,
322
+ 0.1565,
323
+ 0.2851
324
+ ],
325
+ "link": {
326
+ "relation": "REFERS_TO",
327
+ "document": "ausstattungsliste.pdf",
328
+ "identifier": "T 2",
329
+ "confidence": 0.96
330
+ }
331
+ },
332
+ {
333
+ "document": "raumblaetter.pdf",
334
+ "span": "W 1",
335
+ "kind": "identifier",
336
+ "line_id": "p1-l11",
337
+ "line_text": "W 1 Wandtafel, 1 Stück",
338
+ "page": 0,
339
+ "box": [
340
+ 0.1266,
341
+ 0.2919,
342
+ 0.1565,
343
+ 0.3029
344
+ ],
345
+ "link": {
346
+ "relation": "REFERS_TO",
347
+ "document": "ausstattungsliste.pdf",
348
+ "identifier": "W 1",
349
+ "confidence": 0.96
350
+ }
351
+ },
352
+ {
353
+ "document": "raumblaetter.pdf",
354
+ "span": "L 2",
355
+ "kind": "identifier",
356
+ "line_id": "p1-l12",
357
+ "line_text": "L 2 Deckenleuchte, 6 Stück",
358
+ "page": 0,
359
+ "box": [
360
+ 0.1331,
361
+ 0.3098,
362
+ 0.1565,
363
+ 0.3207
364
+ ],
365
+ "link": {
366
+ "relation": "REFERS_TO",
367
+ "document": "ausstattungsliste.pdf",
368
+ "identifier": "L 2",
369
+ "confidence": 0.96
370
+ }
371
+ },
372
+ {
373
+ "document": "raumblaetter.pdf",
374
+ "span": "S1.1",
375
+ "kind": "identifier",
376
+ "line_id": "p1-l13",
377
+ "line_text": "S1.1 Waschtisch, 1 Stück, darüber Spiegel S 2.1",
378
+ "page": 0,
379
+ "box": [
380
+ 0.1219,
381
+ 0.3276,
382
+ 0.1565,
383
+ 0.3386
384
+ ],
385
+ "link": {
386
+ "relation": "REFERS_TO",
387
+ "document": "ausstattungsliste.pdf",
388
+ "identifier": "S 1.1",
389
+ "confidence": 0.9
390
+ }
391
+ },
392
+ {
393
+ "document": "raumblaetter.pdf",
394
+ "span": "S 2.1",
395
+ "kind": "identifier",
396
+ "line_id": "p1-l13",
397
+ "line_text": "S1.1 Waschtisch, 1 Stück, darüber Spiegel S 2.1",
398
+ "page": 0,
399
+ "box": [
400
+ 0.4506,
401
+ 0.3276,
402
+ 0.4898,
403
+ 0.3386
404
+ ],
405
+ "link": {
406
+ "relation": "REFERS_TO",
407
+ "document": "ausstattungsliste.pdf",
408
+ "identifier": "S 2.1",
409
+ "confidence": 0.96
410
+ }
411
+ },
412
+ {
413
+ "document": "raumblaetter.pdf",
414
+ "span": "M 7",
415
+ "kind": "identifier",
416
+ "line_id": "p1-l14",
417
+ "line_text": "M 7 Medienwagen, 1 Stück",
418
+ "page": 0,
419
+ "box": [
420
+ 0.1285,
421
+ 0.3454,
422
+ 0.1565,
423
+ 0.3564
424
+ ],
425
+ "link": null
426
+ },
427
+ {
428
+ "document": "raumblaetter.pdf",
429
+ "span": "0.14",
430
+ "kind": "own_number",
431
+ "line_id": "p2-l2",
432
+ "line_text": "Raum 0.14 WC Mädchen",
433
+ "page": 1,
434
+ "box": [
435
+ 0.2032,
436
+ 0.0837,
437
+ 0.2555,
438
+ 0.1013
439
+ ],
440
+ "link": null
441
+ },
442
+ {
443
+ "document": "raumblaetter.pdf",
444
+ "span": "2,50 m",
445
+ "kind": "value",
446
+ "line_id": "p2-l5",
447
+ "line_text": "Lichte Raumhöhe 2,50 m",
448
+ "page": 1,
449
+ "box": [
450
+ 0.2628,
451
+ 0.1554,
452
+ 0.3142,
453
+ 0.1664
454
+ ],
455
+ "link": null
456
+ },
457
+ {
458
+ "document": "raumblaetter.pdf",
459
+ "span": "DIN 18040",
460
+ "kind": "external",
461
+ "line_id": "p2-l6",
462
+ "line_text": "Barrierefreiheit eine Kabine nach DIN 18040",
463
+ "page": 1,
464
+ "box": [
465
+ 0.3973,
466
+ 0.1732,
467
+ 0.4777,
468
+ 0.1842
469
+ ],
470
+ "link": null
471
+ },
472
+ {
473
+ "document": "raumblaetter.pdf",
474
+ "span": "3.2",
475
+ "kind": "identifier",
476
+ "line_id": "p2-l7",
477
+ "line_text": "Sanitärobjekte siehe Baubeschreibung Kap. 3.2",
478
+ "page": 1,
479
+ "box": [
480
+ 0.4824,
481
+ 0.191,
482
+ 0.5057,
483
+ 0.202
484
+ ],
485
+ "link": {
486
+ "relation": "REFERS_TO",
487
+ "document": "baubeschreibung.pdf",
488
+ "identifier": "3.2",
489
+ "confidence": 0.92
490
+ }
491
+ },
492
+ {
493
+ "document": "raumblaetter.pdf",
494
+ "span": "S 1.2",
495
+ "kind": "identifier",
496
+ "line_id": "p2-l9",
497
+ "line_text": "S 1.2 WC, wandhängend, 3 Stück",
498
+ "page": 1,
499
+ "box": [
500
+ 0.121,
501
+ 0.2563,
502
+ 0.1603,
503
+ 0.2673
504
+ ],
505
+ "link": {
506
+ "relation": "REFERS_TO",
507
+ "document": "ausstattungsliste.pdf",
508
+ "identifier": "S 1.2",
509
+ "confidence": 0.96
510
+ }
511
+ },
512
+ {
513
+ "document": "raumblaetter.pdf",
514
+ "span": "S1.1",
515
+ "kind": "identifier",
516
+ "line_id": "p2-l10",
517
+ "line_text": "S1.1 Waschtisch, 2 Stück",
518
+ "page": 1,
519
+ "box": [
520
+ 0.1257,
521
+ 0.2741,
522
+ 0.1603,
523
+ 0.2851
524
+ ],
525
+ "link": {
526
+ "relation": "REFERS_TO",
527
+ "document": "ausstattungsliste.pdf",
528
+ "identifier": "S 1.1",
529
+ "confidence": 0.9
530
+ }
531
+ },
532
+ {
533
+ "document": "raumblaetter.pdf",
534
+ "span": "S 2.1",
535
+ "kind": "identifier",
536
+ "line_id": "p2-l11",
537
+ "line_text": "S 2.1 Spiegel, 2 Stück",
538
+ "page": 1,
539
+ "box": [
540
+ 0.121,
541
+ 0.2919,
542
+ 0.1603,
543
+ 0.3029
544
+ ],
545
+ "link": {
546
+ "relation": "REFERS_TO",
547
+ "document": "ausstattungsliste.pdf",
548
+ "identifier": "S 2.1",
549
+ "confidence": 0.96
550
+ }
551
+ },
552
+ {
553
+ "document": "raumblaetter.pdf",
554
+ "span": "S.2.2",
555
+ "kind": "identifier",
556
+ "line_id": "p2-l12",
557
+ "line_text": "S.2.2 Seifenspender, 2 Stück",
558
+ "page": 1,
559
+ "box": [
560
+ 0.121,
561
+ 0.3098,
562
+ 0.1603,
563
+ 0.3207
564
+ ],
565
+ "link": {
566
+ "relation": "REFERS_TO",
567
+ "document": "ausstattungsliste.pdf",
568
+ "identifier": "S 2.2",
569
+ "confidence": 0.9
570
+ }
571
+ },
572
+ {
573
+ "document": "raumblaetter.pdf",
574
+ "span": "L1",
575
+ "kind": "identifier",
576
+ "line_id": "p2-l13",
577
+ "line_text": "L1 Wandleuchte über dem Spiegel, 2 Stück",
578
+ "page": 1,
579
+ "box": [
580
+ 0.1416,
581
+ 0.3276,
582
+ 0.1603,
583
+ 0.3386
584
+ ],
585
+ "link": {
586
+ "relation": "REFERS_TO",
587
+ "document": "ausstattungsliste.pdf",
588
+ "identifier": "L 1",
589
+ "confidence": 0.9
590
+ }
591
+ },
592
+ {
593
+ "document": "raumblaetter.pdf",
594
+ "span": "L 3",
595
+ "kind": "identifier",
596
+ "line_id": "p2-l14",
597
+ "line_text": "L 3 Sicherheitsleuchte über der Tür, 1 Stück",
598
+ "page": 1,
599
+ "box": [
600
+ 0.1369,
601
+ 0.3454,
602
+ 0.1603,
603
+ 0.3564
604
+ ],
605
+ "link": {
606
+ "relation": "REFERS_TO",
607
+ "document": "ausstattungsliste.pdf",
608
+ "identifier": "L 3",
609
+ "confidence": 0.96
610
+ }
611
+ }
612
+ ]
613
+ }