@littlebigbrain/create 0.0.0-stage → 0.1.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 (34) hide show
  1. package/LICENSE +55 -0
  2. package/README.md +71 -2
  3. package/bin/create-littlebigbrain.mjs +9 -0
  4. package/lib/create.mjs +238 -0
  5. package/package.json +46 -4
  6. package/project/setup.ts +18 -0
  7. package/project/try.ts +30 -0
  8. package/project/worker.ts +23 -0
  9. package/templates/_shared/testing.ts +490 -0
  10. package/templates/documents-link/README.md +144 -0
  11. package/templates/documents-link/link.ts +580 -0
  12. package/templates/documents-link/samples/ausstattungsliste.pdf +76 -0
  13. package/templates/documents-link/samples/baubeschreibung.pdf +54 -0
  14. package/templates/documents-link/samples/expected.json +404 -0
  15. package/templates/documents-link/samples/pages/ausstattungsliste.json +1150 -0
  16. package/templates/documents-link/samples/pages/baubeschreibung.json +802 -0
  17. package/templates/documents-link/samples/pages/raumblaetter.json +1580 -0
  18. package/templates/documents-link/samples/raumblaetter.pdf +109 -0
  19. package/templates/documents-link/samples.ts +31 -0
  20. package/templates/documents-link/workflow.test.ts +470 -0
  21. package/templates/documents-link/workflow.ts +457 -0
  22. package/templates/ontology-fit/README.md +81 -0
  23. package/templates/ontology-fit/samples/expected.md +88 -0
  24. package/templates/ontology-fit/samples/texts.json +22 -0
  25. package/templates/ontology-fit/samples.ts +40 -0
  26. package/templates/ontology-fit/workflow.test.ts +264 -0
  27. package/templates/ontology-fit/workflow.ts +413 -0
  28. package/templates/values-extract/README.md +81 -0
  29. package/templates/values-extract/samples/expected.json +148 -0
  30. package/templates/values-extract/samples/records.json +26 -0
  31. package/templates/values-extract/samples.ts +27 -0
  32. package/templates/values-extract/workflow.test.ts +256 -0
  33. package/templates/values-extract/workflow.ts +411 -0
  34. package/templates/versions.json +3 -0
@@ -0,0 +1,54 @@
1
+ %PDF-1.4
2
+ 1 0 obj
3
+ << /Type /Catalog /Pages 2 0 R >>
4
+ endobj
5
+ 2 0 obj
6
+ << /Type /Pages /Kids [7 0 R] /Count 1 >>
7
+ endobj
8
+ 3 0 obj
9
+ << /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>
10
+ endobj
11
+ 4 0 obj
12
+ << /Type /Font /Subtype /Type1 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >>
13
+ endobj
14
+ 5 0 obj
15
+ << /Title (Baubeschreibung) /Producer (make-samples.mjs) >>
16
+ endobj
17
+ 6 0 obj
18
+ << /Length 1230 >>
19
+ stream
20
+ 0.35 g BT /F1 8 Tf 1 0 0 1 72 806 Tm (Neubau Grundschule Musterstadt) Tj ET 0 g
21
+ 0.6 G 0.5 w 72 798 m 523 798 l S 0 G
22
+ BT /F2 16 Tf 1 0 0 1 72 760 Tm (Baubeschreibung) Tj ET
23
+ BT /F2 12 Tf 1 0 0 1 72 730 Tm (3 Ausbau) Tj ET
24
+ BT /F2 11 Tf 1 0 0 1 72 708 Tm (3.1 Bodenbel\344ge) Tj ET
25
+ BT /F1 10 Tf 1 0 0 1 72 692 Tm (Klassenr\344ume und Flure erhalten Linoleum, 2,5 mm, vollfl\344chig auf schwimmendem Estrich geklebt.) Tj ET
26
+ BT /F1 10 Tf 1 0 0 1 72 679 Tm (Sanit\344rr\344ume erhalten rutschhemmende Bodenfliesen aus Feinsteinzeug.) Tj ET
27
+ BT /F2 11 Tf 1 0 0 1 72 654 Tm (3.2 Sanit\344robjekte) Tj ET
28
+ BT /F1 10 Tf 1 0 0 1 72 638 Tm (Waschtische, WCs und Urinale sind aus wei\337er Sanit\344rkeramik, die Armaturen sind wassersparend.) Tj ET
29
+ BT /F1 10 Tf 1 0 0 1 72 625 Tm (Die einzelnen Objekte nennt die Ausstattungsliste.) Tj ET
30
+ BT /F2 11 Tf 1 0 0 1 72 600 Tm (3.3 Beleuchtung) Tj ET
31
+ BT /F1 10 Tf 1 0 0 1 72 584 Tm (Alle R\344ume erhalten LED-Leuchten. Die Leuchten der Klassenr\344ume sind tageslichtabh\344ngig) Tj ET
32
+ BT /F1 10 Tf 1 0 0 1 72 571 Tm (dimmbar, Flure und Treppen erhalten Sicherheitsleuchten mit Einzelbatterie.) Tj ET
33
+ 0.6 G 0.5 w 72 52 m 523 52 l S 0 G
34
+ 0.35 g BT /F1 8 Tf 1 0 0 1 476.3 40 Tm (Seite 1 von 1) Tj ET 0 g
35
+ endstream
36
+ endobj
37
+ 7 0 obj
38
+ << /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Resources << /Font << /F1 3 0 R /F2 4 0 R >> >> /Contents 6 0 R >>
39
+ endobj
40
+ xref
41
+ 0 8
42
+ 0000000000 65535 f
43
+ 0000000009 00000 n
44
+ 0000000058 00000 n
45
+ 0000000115 00000 n
46
+ 0000000212 00000 n
47
+ 0000000314 00000 n
48
+ 0000000389 00000 n
49
+ 0000001670 00000 n
50
+ trailer
51
+ << /Size 8 /Root 1 0 R /Info 5 0 R /ID [<075a00f08359cf2795e2bcdfc8ab56d3> <075a00f08359cf2795e2bcdfc8ab56d3>] >>
52
+ startxref
53
+ 1806
54
+ %%EOF
@@ -0,0 +1,404 @@
1
+ {
2
+ "about": [
3
+ "The answer key for the documents-link samples: the entries the two defining files hold, and for each mention on the room sheets the entry it refers to.",
4
+ "All text is invented. make-samples.mjs checks that every line_text is a line of its page and that line_text.slice(start, end) is the span.",
5
+ "page is 1-based. line_text is the line as pdftotext -bbox-layout reads it, its words joined by one space. start and end are JavaScript string offsets into line_text.",
6
+ "Identifiers match as the LBB link stage matches them: without whitespace, without case, and without a dot between leading letters and a digit (S 1.1, S1.1 and S.1.1 match).",
7
+ "A correct run makes every link whose refers_to is an entry, and no other link. A mention with refers_to null must not link; a run may list it as a mention or skip it. A span this key does not list (an area, a count, the running header or footer) must not link either.",
8
+ "accept_spans names other spans a run may report for the same mention (Kap. 3.2 for 3.2). kind is the kind the LBB decision model should give the span."
9
+ ],
10
+ "roles": {
11
+ "ausstattungsliste.pdf": "defines",
12
+ "baubeschreibung.pdf": "defines",
13
+ "raumblaetter.pdf": "refers"
14
+ },
15
+ "notes": [
16
+ "The key assumes the roles above. With the default role both, the room sheets define their room numbers (0.12, 0.14), and each defining line of the other two files is also a mention of its own entry (own_number). None of those mentions should link: no entry of another file describes the same item.",
17
+ "raumblaetter.pdf repeats its header row (Neubau Grundschule Musterstadt, Raumblätter), the rows Geschoss Erdgeschoss and Pos. Ausstattung, and a footer Seite # von 2 on both pages. The LBB rows stage marks a row as running only when it repeats on more than max(2, 30% of the pages) pages, so on two pages these rows stay content. They hold no code.",
18
+ "baubeschreibung.pdf defines the chapter 3 Ausbau above its sections. A run may list 3 as an entry (optional below); no mention refers to it."
19
+ ],
20
+ "entries": [
21
+ {
22
+ "file": "ausstattungsliste.pdf",
23
+ "page": 1,
24
+ "identifier": "S 1.1",
25
+ "line_text": "S 1.1 Waschtisch, Keramik, ca. 55x45 cm, mit Einhebelmischer"
26
+ },
27
+ {
28
+ "file": "ausstattungsliste.pdf",
29
+ "page": 1,
30
+ "identifier": "S 1.2",
31
+ "line_text": "S 1.2 WC, wandhängend, mit Unterputz-Spülkasten"
32
+ },
33
+ {
34
+ "file": "ausstattungsliste.pdf",
35
+ "page": 1,
36
+ "identifier": "S 1.3",
37
+ "line_text": "S 1.3 Urinal, Keramik, mit Spülsteuerung"
38
+ },
39
+ {
40
+ "file": "ausstattungsliste.pdf",
41
+ "page": 1,
42
+ "identifier": "S 2.1",
43
+ "line_text": "S 2.1 Spiegel, Kristallglas, 60x45 cm"
44
+ },
45
+ {
46
+ "file": "ausstattungsliste.pdf",
47
+ "page": 1,
48
+ "identifier": "S 2.2",
49
+ "line_text": "S 2.2 Seifenspender, Edelstahl, 0,5 l"
50
+ },
51
+ {
52
+ "file": "ausstattungsliste.pdf",
53
+ "page": 1,
54
+ "identifier": "T 1",
55
+ "line_text": "T 1 Einzeltisch, 70x50 cm, höhenverstellbar"
56
+ },
57
+ {
58
+ "file": "ausstattungsliste.pdf",
59
+ "page": 1,
60
+ "identifier": "T 2",
61
+ "line_text": "T 2 Lehrertisch, 140x70 cm"
62
+ },
63
+ {
64
+ "file": "ausstattungsliste.pdf",
65
+ "page": 1,
66
+ "identifier": "T 3",
67
+ "line_text": "T 3 Schülerstuhl, Kunststoff, Größe 5"
68
+ },
69
+ {
70
+ "file": "ausstattungsliste.pdf",
71
+ "page": 1,
72
+ "identifier": "L 1",
73
+ "line_text": "L 1 Wandleuchte LED, 12 W"
74
+ },
75
+ {
76
+ "file": "ausstattungsliste.pdf",
77
+ "page": 1,
78
+ "identifier": "L 2",
79
+ "line_text": "L 2 Deckenleuchte LED, 36 W, dimmbar"
80
+ },
81
+ {
82
+ "file": "ausstattungsliste.pdf",
83
+ "page": 1,
84
+ "identifier": "L 3",
85
+ "line_text": "L 3 Sicherheitsleuchte mit Einzelbatterie"
86
+ },
87
+ {
88
+ "file": "ausstattungsliste.pdf",
89
+ "page": 1,
90
+ "identifier": "W 1",
91
+ "line_text": "W 1 Wandtafel, Klapptafel, 200x100 cm"
92
+ },
93
+ {
94
+ "file": "baubeschreibung.pdf",
95
+ "page": 1,
96
+ "identifier": "3",
97
+ "line_text": "3 Ausbau",
98
+ "optional": true,
99
+ "reason": "The chapter heading above the three sections. A run may list it or leave it out."
100
+ },
101
+ {
102
+ "file": "baubeschreibung.pdf",
103
+ "page": 1,
104
+ "identifier": "3.1",
105
+ "line_text": "3.1 Bodenbeläge"
106
+ },
107
+ {
108
+ "file": "baubeschreibung.pdf",
109
+ "page": 1,
110
+ "identifier": "3.2",
111
+ "line_text": "3.2 Sanitärobjekte"
112
+ },
113
+ {
114
+ "file": "baubeschreibung.pdf",
115
+ "page": 1,
116
+ "identifier": "3.3",
117
+ "line_text": "3.3 Beleuchtung"
118
+ }
119
+ ],
120
+ "mentions": [
121
+ {
122
+ "file": "raumblaetter.pdf",
123
+ "page": 1,
124
+ "line_text": "Raum 0.12 Klassenraum",
125
+ "span": "0.12",
126
+ "start": 5,
127
+ "end": 9,
128
+ "kind": "own_number",
129
+ "refers_to": null,
130
+ "reason": "The room's own number. No file defines room numbers as entries."
131
+ },
132
+ {
133
+ "file": "raumblaetter.pdf",
134
+ "page": 1,
135
+ "line_text": "Lichte Raumhöhe 3,00 m",
136
+ "span": "3,00 m",
137
+ "start": 16,
138
+ "end": 22,
139
+ "kind": "value",
140
+ "refers_to": null,
141
+ "reason": "A measure."
142
+ },
143
+ {
144
+ "file": "raumblaetter.pdf",
145
+ "page": 1,
146
+ "line_text": "Bodenbelag Linoleum, siehe Baubeschreibung Kap. 3.1",
147
+ "span": "3.1",
148
+ "start": 48,
149
+ "end": 51,
150
+ "accept_spans": [
151
+ "Kap. 3.1"
152
+ ],
153
+ "kind": "identifier",
154
+ "refers_to": {
155
+ "file": "baubeschreibung.pdf",
156
+ "identifier": "3.1"
157
+ },
158
+ "reason": "Cites section 3.1 of the spec. The words before it name the spec."
159
+ },
160
+ {
161
+ "file": "raumblaetter.pdf",
162
+ "page": 1,
163
+ "line_text": "T1 Einzeltisch, 28 Stück",
164
+ "span": "T1",
165
+ "start": 0,
166
+ "end": 2,
167
+ "kind": "identifier",
168
+ "refers_to": {
169
+ "file": "ausstattungsliste.pdf",
170
+ "identifier": "T 1"
171
+ },
172
+ "reason": "T 1 written without its space; the description matches."
173
+ },
174
+ {
175
+ "file": "raumblaetter.pdf",
176
+ "page": 1,
177
+ "line_text": "T 3 Schülerstuhl, 28 Stück",
178
+ "span": "T 3",
179
+ "start": 0,
180
+ "end": 3,
181
+ "kind": "identifier",
182
+ "refers_to": {
183
+ "file": "ausstattungsliste.pdf",
184
+ "identifier": "T 3"
185
+ },
186
+ "reason": "Same spelling as the entry."
187
+ },
188
+ {
189
+ "file": "raumblaetter.pdf",
190
+ "page": 1,
191
+ "line_text": "T 2 Lehrertisch, 1 Stück",
192
+ "span": "T 2",
193
+ "start": 0,
194
+ "end": 3,
195
+ "kind": "identifier",
196
+ "refers_to": {
197
+ "file": "ausstattungsliste.pdf",
198
+ "identifier": "T 2"
199
+ },
200
+ "reason": "Same spelling as the entry."
201
+ },
202
+ {
203
+ "file": "raumblaetter.pdf",
204
+ "page": 1,
205
+ "line_text": "W 1 Wandtafel, 1 Stück",
206
+ "span": "W 1",
207
+ "start": 0,
208
+ "end": 3,
209
+ "kind": "identifier",
210
+ "refers_to": {
211
+ "file": "ausstattungsliste.pdf",
212
+ "identifier": "W 1"
213
+ },
214
+ "reason": "Same spelling as the entry."
215
+ },
216
+ {
217
+ "file": "raumblaetter.pdf",
218
+ "page": 1,
219
+ "line_text": "L 2 Deckenleuchte, 6 Stück",
220
+ "span": "L 2",
221
+ "start": 0,
222
+ "end": 3,
223
+ "kind": "identifier",
224
+ "refers_to": {
225
+ "file": "ausstattungsliste.pdf",
226
+ "identifier": "L 2"
227
+ },
228
+ "reason": "Same spelling as the entry."
229
+ },
230
+ {
231
+ "file": "raumblaetter.pdf",
232
+ "page": 1,
233
+ "line_text": "S1.1 Waschtisch, 1 Stück, darüber Spiegel S 2.1",
234
+ "span": "S1.1",
235
+ "start": 0,
236
+ "end": 4,
237
+ "kind": "identifier",
238
+ "refers_to": {
239
+ "file": "ausstattungsliste.pdf",
240
+ "identifier": "S 1.1"
241
+ },
242
+ "reason": "S 1.1 written without its space. S 1.2 and S 2.1 differ by one more character; the description (Waschtisch) confirms S 1.1."
243
+ },
244
+ {
245
+ "file": "raumblaetter.pdf",
246
+ "page": 1,
247
+ "line_text": "S1.1 Waschtisch, 1 Stück, darüber Spiegel S 2.1",
248
+ "span": "S 2.1",
249
+ "start": 42,
250
+ "end": 47,
251
+ "kind": "identifier",
252
+ "refers_to": {
253
+ "file": "ausstattungsliste.pdf",
254
+ "identifier": "S 2.1"
255
+ },
256
+ "reason": "A second code in the same row, inside the description text."
257
+ },
258
+ {
259
+ "file": "raumblaetter.pdf",
260
+ "page": 1,
261
+ "line_text": "M 7 Medienwagen, 1 Stück",
262
+ "span": "M 7",
263
+ "start": 0,
264
+ "end": 3,
265
+ "kind": "identifier",
266
+ "refers_to": null,
267
+ "reason": "A code that no file defines. The equipment list has no Medienwagen."
268
+ },
269
+ {
270
+ "file": "raumblaetter.pdf",
271
+ "page": 2,
272
+ "line_text": "Raum 0.14 WC Mädchen",
273
+ "span": "0.14",
274
+ "start": 5,
275
+ "end": 9,
276
+ "kind": "own_number",
277
+ "refers_to": null,
278
+ "reason": "The room's own number. No file defines room numbers as entries."
279
+ },
280
+ {
281
+ "file": "raumblaetter.pdf",
282
+ "page": 2,
283
+ "line_text": "Lichte Raumhöhe 2,50 m",
284
+ "span": "2,50 m",
285
+ "start": 16,
286
+ "end": 22,
287
+ "kind": "value",
288
+ "refers_to": null,
289
+ "reason": "A measure."
290
+ },
291
+ {
292
+ "file": "raumblaetter.pdf",
293
+ "page": 2,
294
+ "line_text": "Barrierefreiheit eine Kabine nach DIN 18040",
295
+ "span": "DIN 18040",
296
+ "start": 34,
297
+ "end": 43,
298
+ "kind": "external",
299
+ "refers_to": null,
300
+ "reason": "A standard. No sample file defines it."
301
+ },
302
+ {
303
+ "file": "raumblaetter.pdf",
304
+ "page": 2,
305
+ "line_text": "Sanitärobjekte siehe Baubeschreibung Kap. 3.2",
306
+ "span": "3.2",
307
+ "start": 42,
308
+ "end": 45,
309
+ "accept_spans": [
310
+ "Kap. 3.2"
311
+ ],
312
+ "kind": "identifier",
313
+ "refers_to": {
314
+ "file": "baubeschreibung.pdf",
315
+ "identifier": "3.2"
316
+ },
317
+ "reason": "Cites section 3.2 of the spec, whose heading is the row's label."
318
+ },
319
+ {
320
+ "file": "raumblaetter.pdf",
321
+ "page": 2,
322
+ "line_text": "S 1.2 WC, wandhängend, 3 Stück",
323
+ "span": "S 1.2",
324
+ "start": 0,
325
+ "end": 5,
326
+ "kind": "identifier",
327
+ "refers_to": {
328
+ "file": "ausstattungsliste.pdf",
329
+ "identifier": "S 1.2"
330
+ },
331
+ "reason": "Same spelling as the entry."
332
+ },
333
+ {
334
+ "file": "raumblaetter.pdf",
335
+ "page": 2,
336
+ "line_text": "S1.1 Waschtisch, 2 Stück",
337
+ "span": "S1.1",
338
+ "start": 0,
339
+ "end": 4,
340
+ "kind": "identifier",
341
+ "refers_to": {
342
+ "file": "ausstattungsliste.pdf",
343
+ "identifier": "S 1.1"
344
+ },
345
+ "reason": "S 1.1 without its space, on a second page."
346
+ },
347
+ {
348
+ "file": "raumblaetter.pdf",
349
+ "page": 2,
350
+ "line_text": "S 2.1 Spiegel, 2 Stück",
351
+ "span": "S 2.1",
352
+ "start": 0,
353
+ "end": 5,
354
+ "kind": "identifier",
355
+ "refers_to": {
356
+ "file": "ausstattungsliste.pdf",
357
+ "identifier": "S 2.1"
358
+ },
359
+ "reason": "Same spelling as the entry, on a second page."
360
+ },
361
+ {
362
+ "file": "raumblaetter.pdf",
363
+ "page": 2,
364
+ "line_text": "S.2.2 Seifenspender, 2 Stück",
365
+ "span": "S.2.2",
366
+ "start": 0,
367
+ "end": 5,
368
+ "kind": "identifier",
369
+ "refers_to": {
370
+ "file": "ausstattungsliste.pdf",
371
+ "identifier": "S 2.2"
372
+ },
373
+ "reason": "S 2.2 written with a dot after the letter."
374
+ },
375
+ {
376
+ "file": "raumblaetter.pdf",
377
+ "page": 2,
378
+ "line_text": "L1 Wandleuchte über dem Spiegel, 2 Stück",
379
+ "span": "L1",
380
+ "start": 0,
381
+ "end": 2,
382
+ "kind": "identifier",
383
+ "refers_to": {
384
+ "file": "ausstattungsliste.pdf",
385
+ "identifier": "L 1"
386
+ },
387
+ "reason": "L 1 written without its space."
388
+ },
389
+ {
390
+ "file": "raumblaetter.pdf",
391
+ "page": 2,
392
+ "line_text": "L 3 Sicherheitsleuchte über der Tür, 1 Stück",
393
+ "span": "L 3",
394
+ "start": 0,
395
+ "end": 3,
396
+ "kind": "identifier",
397
+ "refers_to": {
398
+ "file": "ausstattungsliste.pdf",
399
+ "identifier": "L 3"
400
+ },
401
+ "reason": "Same spelling as the entry."
402
+ }
403
+ ]
404
+ }