@hawkeyexl/manni 4.11.0 → 4.12.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 +1 -1
- package/dist/{batch-UAULUMGH.js → batch-EFSFG6GC.js} +20 -19
- package/dist/build-NIO3UIWJ.js +36 -0
- package/dist/calibrate-6VO7URRV.js +41 -0
- package/dist/capture-NMBVJO3C.js +38 -0
- package/dist/check-SHOYX2B5.js +30 -0
- package/dist/check-XMJKH3KV.js +34 -0
- package/dist/{check-VELUQAUW.js → check-Y62BJNC4.js} +35 -34
- package/dist/{check-VELUQAUW.js.map → check-Y62BJNC4.js.map} +1 -1
- package/dist/{check-YEOYBFST.js → check-ZMO3ZLMW.js} +19 -18
- package/dist/{chunk-BKVHX6FU.js → chunk-24AJK2RG.js} +5 -10
- package/dist/chunk-24AJK2RG.js.map +1 -0
- package/dist/{chunk-M42DZCOU.js → chunk-2OZF2VUB.js} +2 -2
- package/dist/chunk-2UJZXVHR.js +1868 -0
- package/dist/chunk-2UJZXVHR.js.map +1 -0
- package/dist/{chunk-HQR2ZBHW.js → chunk-3BRJCQPY.js} +36 -7
- package/dist/chunk-3BRJCQPY.js.map +1 -0
- package/dist/{chunk-U7CTFN2J.js → chunk-42VFJOAF.js} +7 -7
- package/dist/{chunk-LBSCW232.js → chunk-4Q24OYI3.js} +7 -7
- package/dist/{chunk-OPXWPJDA.js → chunk-4WJTURRO.js} +14 -14
- package/dist/{chunk-GDVZ5VII.js → chunk-5SID2SVL.js} +4 -4
- package/dist/{chunk-FUCPZVRY.js → chunk-AANUY4BH.js} +2 -2
- package/dist/chunk-ANPIIYRH.js +2272 -0
- package/dist/chunk-ANPIIYRH.js.map +1 -0
- package/dist/{chunk-WDWXAYVH.js → chunk-AYVKN3PG.js} +4 -4
- package/dist/{chunk-FQXWVS6J.js → chunk-CH6IOGXV.js} +9 -9
- package/dist/{chunk-4CK6ZSOK.js → chunk-D5Z6B4M7.js} +3 -3
- package/dist/{chunk-HA6MQMOY.js → chunk-D6SELXQ2.js} +6 -6
- package/dist/{chunk-2DRHT73U.js → chunk-DDILEF5F.js} +890 -1399
- package/dist/chunk-DDILEF5F.js.map +1 -0
- package/dist/{chunk-PCS4VJBV.js → chunk-DGRLHDM4.js} +9 -9
- package/dist/{chunk-2MJ62AYQ.js → chunk-DHGB4JBG.js} +4 -3
- package/dist/chunk-DHGB4JBG.js.map +1 -0
- package/dist/{chunk-Y6DOMTQD.js → chunk-DLU5FCFT.js} +27 -27
- package/dist/chunk-DLU5FCFT.js.map +1 -0
- package/dist/chunk-DSWKBZWW.js +16 -0
- package/dist/chunk-DSWKBZWW.js.map +1 -0
- package/dist/{chunk-KGEQJ5CC.js → chunk-F564FHMQ.js} +8 -8
- package/dist/{chunk-J6IDQGJL.js → chunk-FKAZUZQU.js} +469 -85
- package/dist/chunk-FKAZUZQU.js.map +1 -0
- package/dist/{chunk-IGSHYP74.js → chunk-G3MBUL5M.js} +4 -4
- package/dist/{chunk-ADMEPUBT.js → chunk-GQ3KRY3B.js} +3 -3
- package/dist/{chunk-T7JAOYE5.js → chunk-HDPN46JP.js} +6 -6
- package/dist/{chunk-R4WXQIOZ.js → chunk-IQQAJROD.js} +3 -3
- package/dist/{chunk-2IR4T5PO.js → chunk-IZXN3WI6.js} +2 -2
- package/dist/{chunk-NCPWXHDO.js → chunk-JEUFYSFQ.js} +4 -4
- package/dist/{chunk-LKP7QDFN.js → chunk-JSSM7VVV.js} +4 -4
- package/dist/{chunk-2IAZEB45.js → chunk-KFGZPVFA.js} +229 -821
- package/dist/chunk-KFGZPVFA.js.map +1 -0
- package/dist/{chunk-EIFCP6CZ.js → chunk-KGFSPJLD.js} +2 -2
- package/dist/{chunk-RLT5SEML.js → chunk-KMORGMCW.js} +6 -6
- package/dist/{chunk-WQWKYAAK.js → chunk-NUQF5F5J.js} +2 -2
- package/dist/{chunk-54F74XR3.js → chunk-NZ6KSHFD.js} +19 -19
- package/dist/{chunk-4D5IZSXM.js → chunk-OHUDZRLK.js} +3 -3
- package/dist/{chunk-FBMZJEB3.js → chunk-OKMTUAWO.js} +4 -4
- package/dist/{chunk-QLWC7MKD.js → chunk-OTJOBZJ5.js} +135 -135
- package/dist/chunk-OTJOBZJ5.js.map +1 -0
- package/dist/{chunk-6HWBRZIN.js → chunk-PS257NIU.js} +252 -193
- package/dist/chunk-PS257NIU.js.map +1 -0
- package/dist/chunk-QDC7JPFG.js +685 -0
- package/dist/chunk-QDC7JPFG.js.map +1 -0
- package/dist/{chunk-PCQ7ELJH.js → chunk-QEAGL4V5.js} +109 -5
- package/dist/chunk-QEAGL4V5.js.map +1 -0
- package/dist/{chunk-BBT6AVUG.js → chunk-QMY57PVW.js} +2 -2
- package/dist/{chunk-LPIF5LIE.js → chunk-QNDDPXFR.js} +2 -2
- package/dist/{chunk-PWBH7DCQ.js → chunk-QSIXNTRV.js} +4 -4
- package/dist/{chunk-VSEBFHAY.js → chunk-RGLFV4KO.js} +11369 -10218
- package/dist/chunk-RGLFV4KO.js.map +1 -0
- package/dist/{chunk-D4N2V43Z.js → chunk-SGR7ZAVE.js} +13 -7
- package/dist/chunk-SGR7ZAVE.js.map +1 -0
- package/dist/{chunk-GV56WGL2.js → chunk-SMHAYK6I.js} +1036 -883
- package/dist/chunk-SMHAYK6I.js.map +1 -0
- package/dist/{chunk-JPQDNYXH.js → chunk-STPGIKPY.js} +8 -2
- package/dist/chunk-STPGIKPY.js.map +1 -0
- package/dist/{chunk-NSBXVPZL.js → chunk-U22TOL5Y.js} +17 -17
- package/dist/{chunk-NGTVREIH.js → chunk-U6IHLEWT.js} +2 -2
- package/dist/{chunk-ODRPL3WB.js → chunk-UUCCV3SI.js} +2 -2
- package/dist/{chunk-MSRU4D4P.js → chunk-UXMCHBOJ.js} +2 -2
- package/dist/{chunk-B7XYNRJQ.js → chunk-VFAKGIDG.js} +2 -2
- package/dist/{chunk-QCHVR4ZM.js → chunk-VM7VAFJW.js} +33 -7
- package/dist/chunk-VM7VAFJW.js.map +1 -0
- package/dist/{chunk-VQK4VHLF.js → chunk-YQV75FIL.js} +2 -2
- package/dist/chunk-YUTVAMWW.js +2 -0
- package/dist/{cli-4MF37HAQ.js → cli-4CR7QIOK.js} +26 -25
- package/dist/{cli-4MF37HAQ.js.map → cli-4CR7QIOK.js.map} +1 -1
- package/dist/{cli-6KZTHWGP.js → cli-6R4W3HAH.js} +37 -36
- package/dist/{cli-6KZTHWGP.js.map → cli-6R4W3HAH.js.map} +1 -1
- package/dist/{cli-I62SRH3R.js → cli-BOMA2FMP.js} +14 -13
- package/dist/{cli-DRMZBZLB.js → cli-EDQPQOCE.js} +43 -42
- package/dist/{cli-DRMZBZLB.js.map → cli-EDQPQOCE.js.map} +1 -1
- package/dist/{cli-VID7PJS3.js → cli-GBF76EXT.js} +23 -22
- package/dist/{cli-VID7PJS3.js.map → cli-GBF76EXT.js.map} +1 -1
- package/dist/{cli-3BTCK4AB.js → cli-MQYCF3SR.js} +27 -26
- package/dist/{cli-3BTCK4AB.js.map → cli-MQYCF3SR.js.map} +1 -1
- package/dist/{cli-ONTC5PKT.js → cli-OJKFXQOM.js} +9 -9
- package/dist/{cli-VUKMWSSF.js → cli-PHZAO4LZ.js} +4 -4
- package/dist/{cli-RORDPAPE.js → cli-PTKFFNOW.js} +59 -38
- package/dist/cli-PTKFFNOW.js.map +1 -0
- package/dist/{cli-O4ABTN4Z.js → cli-UW2K5Z5J.js} +31 -30
- package/dist/{cli-O4ABTN4Z.js.map → cli-UW2K5Z5J.js.map} +1 -1
- package/dist/{cli-JJMOVIKS.js → cli-XXTNPPKB.js} +14 -14
- package/dist/cli.js +19 -13
- package/dist/cli.js.map +1 -1
- package/dist/{config-XDA42RJL.js → config-JJW75SBX.js} +5 -5
- package/dist/docmeta.js +13 -12
- package/dist/docmeta.js.map +1 -1
- package/dist/github-6VQKSB67.js +35 -0
- package/dist/github-RBSEM7ZK.js +30 -0
- package/dist/graph/runtime.d.ts +4 -1
- package/dist/graph/runtime.js +20 -9
- package/dist/graph/runtime.js.map +1 -1
- package/dist/{host-6GURH5HE.js → host-YSTYO5DX.js} +3 -3
- package/dist/index.d.ts +192 -26
- package/dist/index.js +129 -124
- package/dist/index.js.map +1 -1
- package/dist/{json-BXY44ED7.js → json-PU2HLHDQ.js} +18 -17
- package/dist/labels-SJNSOPBI.js +73 -0
- package/dist/labels-SJNSOPBI.js.map +1 -0
- package/dist/lint-KIVTHLGU.js +34 -0
- package/dist/list-RDEJDDJF.js +32 -0
- package/dist/list-SUTDWL2J.js +35 -0
- package/dist/{page-EV7OUBAU.js → page-UMAA3NCM.js} +18 -16
- package/dist/{prepare-JHJDJB6I.js → prepare-3I3LOXXD.js} +22 -21
- package/dist/{prepare-JHJDJB6I.js.map → prepare-3I3LOXXD.js.map} +1 -1
- package/dist/{pretty-SCRK66M5.js → pretty-ANLRHU4O.js} +18 -17
- package/dist/{pretty-Q5Y2PA64.js → pretty-Q3ZFKOR7.js} +18 -17
- package/dist/{provider-527CO4DM.js → provider-LBX4IXGX.js} +3 -3
- package/dist/{release-3D5PK6M7.js → release-VV3UTKE5.js} +3 -3
- package/dist/{reporters-M6LJ2IYU.js → reporters-26H3N2KW.js} +3 -3
- package/dist/{reporters-RBYTASMI.js → reporters-ILT36CIH.js} +7 -7
- package/dist/{reporters-A5ADKDYR.js → reporters-PNDLWT6K.js} +16 -15
- package/dist/run-QXCK33Z4.js +37 -0
- package/dist/{term-CQAGNG3Q.js → term-D2N7UN4P.js} +981 -141
- package/dist/term-D2N7UN4P.js.map +1 -0
- package/dist/validate-BRUCOT2O.js +19 -0
- package/package.json +3 -2
- package/plugin/manni/.claude-plugin/plugin.json +1 -1
- package/shapes/graph/shapes-1.1.0.ttl +785 -0
- package/dist/build-QSPNK5AL.js +0 -35
- package/dist/calibrate-KXN4URPM.js +0 -40
- package/dist/capture-JHTSUPUC.js +0 -37
- package/dist/check-MDGXEUWL.js +0 -20
- package/dist/check-WOQRKNZK.js +0 -29
- package/dist/chunk-2DRHT73U.js.map +0 -1
- package/dist/chunk-2IAZEB45.js.map +0 -1
- package/dist/chunk-2MJ62AYQ.js.map +0 -1
- package/dist/chunk-4VBSTXN6.js +0 -392
- package/dist/chunk-4VBSTXN6.js.map +0 -1
- package/dist/chunk-6HWBRZIN.js.map +0 -1
- package/dist/chunk-BKVHX6FU.js.map +0 -1
- package/dist/chunk-D4N2V43Z.js.map +0 -1
- package/dist/chunk-EFW7CAG4.js +0 -387
- package/dist/chunk-EFW7CAG4.js.map +0 -1
- package/dist/chunk-GV56WGL2.js.map +0 -1
- package/dist/chunk-HQR2ZBHW.js.map +0 -1
- package/dist/chunk-J6IDQGJL.js.map +0 -1
- package/dist/chunk-JPQDNYXH.js.map +0 -1
- package/dist/chunk-JROBZ7JA.js +0 -818
- package/dist/chunk-JROBZ7JA.js.map +0 -1
- package/dist/chunk-PCQ7ELJH.js.map +0 -1
- package/dist/chunk-QCHVR4ZM.js.map +0 -1
- package/dist/chunk-QLWC7MKD.js.map +0 -1
- package/dist/chunk-TU2WUBVZ.js +0 -2
- package/dist/chunk-VSEBFHAY.js.map +0 -1
- package/dist/chunk-Y6DOMTQD.js.map +0 -1
- package/dist/cli-RORDPAPE.js.map +0 -1
- package/dist/github-RY3FRA6P.js +0 -29
- package/dist/github-YKQSH7FS.js +0 -34
- package/dist/lint-YJ2L22BW.js +0 -33
- package/dist/list-NSG24VVX.js +0 -31
- package/dist/list-V6EGCSHX.js +0 -34
- package/dist/run-BUE2DDXN.js +0 -36
- package/dist/term-CQAGNG3Q.js.map +0 -1
- package/dist/validate-ZBW44RHT.js +0 -18
- /package/dist/{batch-UAULUMGH.js.map → batch-EFSFG6GC.js.map} +0 -0
- /package/dist/{build-QSPNK5AL.js.map → build-NIO3UIWJ.js.map} +0 -0
- /package/dist/{calibrate-KXN4URPM.js.map → calibrate-6VO7URRV.js.map} +0 -0
- /package/dist/{capture-JHTSUPUC.js.map → capture-NMBVJO3C.js.map} +0 -0
- /package/dist/{check-MDGXEUWL.js.map → check-SHOYX2B5.js.map} +0 -0
- /package/dist/{check-WOQRKNZK.js.map → check-XMJKH3KV.js.map} +0 -0
- /package/dist/{check-YEOYBFST.js.map → check-ZMO3ZLMW.js.map} +0 -0
- /package/dist/{chunk-M42DZCOU.js.map → chunk-2OZF2VUB.js.map} +0 -0
- /package/dist/{chunk-U7CTFN2J.js.map → chunk-42VFJOAF.js.map} +0 -0
- /package/dist/{chunk-LBSCW232.js.map → chunk-4Q24OYI3.js.map} +0 -0
- /package/dist/{chunk-OPXWPJDA.js.map → chunk-4WJTURRO.js.map} +0 -0
- /package/dist/{chunk-GDVZ5VII.js.map → chunk-5SID2SVL.js.map} +0 -0
- /package/dist/{chunk-FUCPZVRY.js.map → chunk-AANUY4BH.js.map} +0 -0
- /package/dist/{chunk-WDWXAYVH.js.map → chunk-AYVKN3PG.js.map} +0 -0
- /package/dist/{chunk-FQXWVS6J.js.map → chunk-CH6IOGXV.js.map} +0 -0
- /package/dist/{chunk-4CK6ZSOK.js.map → chunk-D5Z6B4M7.js.map} +0 -0
- /package/dist/{chunk-HA6MQMOY.js.map → chunk-D6SELXQ2.js.map} +0 -0
- /package/dist/{chunk-PCS4VJBV.js.map → chunk-DGRLHDM4.js.map} +0 -0
- /package/dist/{chunk-KGEQJ5CC.js.map → chunk-F564FHMQ.js.map} +0 -0
- /package/dist/{chunk-IGSHYP74.js.map → chunk-G3MBUL5M.js.map} +0 -0
- /package/dist/{chunk-ADMEPUBT.js.map → chunk-GQ3KRY3B.js.map} +0 -0
- /package/dist/{chunk-T7JAOYE5.js.map → chunk-HDPN46JP.js.map} +0 -0
- /package/dist/{chunk-R4WXQIOZ.js.map → chunk-IQQAJROD.js.map} +0 -0
- /package/dist/{chunk-2IR4T5PO.js.map → chunk-IZXN3WI6.js.map} +0 -0
- /package/dist/{chunk-NCPWXHDO.js.map → chunk-JEUFYSFQ.js.map} +0 -0
- /package/dist/{chunk-LKP7QDFN.js.map → chunk-JSSM7VVV.js.map} +0 -0
- /package/dist/{chunk-EIFCP6CZ.js.map → chunk-KGFSPJLD.js.map} +0 -0
- /package/dist/{chunk-RLT5SEML.js.map → chunk-KMORGMCW.js.map} +0 -0
- /package/dist/{chunk-WQWKYAAK.js.map → chunk-NUQF5F5J.js.map} +0 -0
- /package/dist/{chunk-54F74XR3.js.map → chunk-NZ6KSHFD.js.map} +0 -0
- /package/dist/{chunk-4D5IZSXM.js.map → chunk-OHUDZRLK.js.map} +0 -0
- /package/dist/{chunk-FBMZJEB3.js.map → chunk-OKMTUAWO.js.map} +0 -0
- /package/dist/{chunk-BBT6AVUG.js.map → chunk-QMY57PVW.js.map} +0 -0
- /package/dist/{chunk-LPIF5LIE.js.map → chunk-QNDDPXFR.js.map} +0 -0
- /package/dist/{chunk-PWBH7DCQ.js.map → chunk-QSIXNTRV.js.map} +0 -0
- /package/dist/{chunk-NSBXVPZL.js.map → chunk-U22TOL5Y.js.map} +0 -0
- /package/dist/{chunk-NGTVREIH.js.map → chunk-U6IHLEWT.js.map} +0 -0
- /package/dist/{chunk-ODRPL3WB.js.map → chunk-UUCCV3SI.js.map} +0 -0
- /package/dist/{chunk-MSRU4D4P.js.map → chunk-UXMCHBOJ.js.map} +0 -0
- /package/dist/{chunk-B7XYNRJQ.js.map → chunk-VFAKGIDG.js.map} +0 -0
- /package/dist/{chunk-VQK4VHLF.js.map → chunk-YQV75FIL.js.map} +0 -0
- /package/dist/{chunk-TU2WUBVZ.js.map → chunk-YUTVAMWW.js.map} +0 -0
- /package/dist/{cli-I62SRH3R.js.map → cli-BOMA2FMP.js.map} +0 -0
- /package/dist/{cli-ONTC5PKT.js.map → cli-OJKFXQOM.js.map} +0 -0
- /package/dist/{cli-VUKMWSSF.js.map → cli-PHZAO4LZ.js.map} +0 -0
- /package/dist/{cli-JJMOVIKS.js.map → cli-XXTNPPKB.js.map} +0 -0
- /package/dist/{config-XDA42RJL.js.map → config-JJW75SBX.js.map} +0 -0
- /package/dist/{github-RY3FRA6P.js.map → github-6VQKSB67.js.map} +0 -0
- /package/dist/{github-YKQSH7FS.js.map → github-RBSEM7ZK.js.map} +0 -0
- /package/dist/{host-6GURH5HE.js.map → host-YSTYO5DX.js.map} +0 -0
- /package/dist/{json-BXY44ED7.js.map → json-PU2HLHDQ.js.map} +0 -0
- /package/dist/{lint-YJ2L22BW.js.map → lint-KIVTHLGU.js.map} +0 -0
- /package/dist/{list-NSG24VVX.js.map → list-RDEJDDJF.js.map} +0 -0
- /package/dist/{list-V6EGCSHX.js.map → list-SUTDWL2J.js.map} +0 -0
- /package/dist/{page-EV7OUBAU.js.map → page-UMAA3NCM.js.map} +0 -0
- /package/dist/{pretty-Q5Y2PA64.js.map → pretty-ANLRHU4O.js.map} +0 -0
- /package/dist/{pretty-SCRK66M5.js.map → pretty-Q3ZFKOR7.js.map} +0 -0
- /package/dist/{provider-527CO4DM.js.map → provider-LBX4IXGX.js.map} +0 -0
- /package/dist/{release-3D5PK6M7.js.map → release-VV3UTKE5.js.map} +0 -0
- /package/dist/{reporters-A5ADKDYR.js.map → reporters-26H3N2KW.js.map} +0 -0
- /package/dist/{reporters-M6LJ2IYU.js.map → reporters-ILT36CIH.js.map} +0 -0
- /package/dist/{reporters-RBYTASMI.js.map → reporters-PNDLWT6K.js.map} +0 -0
- /package/dist/{run-BUE2DDXN.js.map → run-QXCK33Z4.js.map} +0 -0
- /package/dist/{validate-ZBW44RHT.js.map → validate-BRUCOT2O.js.map} +0 -0
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
SEVERITIES
|
|
4
|
-
} from "./chunk-77AINBYM.js";
|
|
5
2
|
import {
|
|
6
3
|
codeEndAt,
|
|
7
4
|
codeRegions
|
|
@@ -10,7 +7,7 @@ import {
|
|
|
10
7
|
CONCEPT_FIELDS,
|
|
11
8
|
fieldPointer,
|
|
12
9
|
valueAt
|
|
13
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PS257NIU.js";
|
|
14
11
|
import {
|
|
15
12
|
STDIN_LABEL,
|
|
16
13
|
STDIN_TOKEN,
|
|
@@ -21,13 +18,16 @@ import {
|
|
|
21
18
|
locateFrontmatter,
|
|
22
19
|
resolveTargetSet,
|
|
23
20
|
supportedExtensions
|
|
24
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-RGLFV4KO.js";
|
|
22
|
+
import {
|
|
23
|
+
SEVERITIES
|
|
24
|
+
} from "./chunk-77AINBYM.js";
|
|
25
25
|
import {
|
|
26
26
|
findConfigFile,
|
|
27
27
|
readConfigFile,
|
|
28
28
|
selectCollections,
|
|
29
29
|
valeConfigPath
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-OTJOBZJ5.js";
|
|
31
31
|
import {
|
|
32
32
|
ToolError,
|
|
33
33
|
errorMessage
|
|
@@ -53,6 +53,12 @@ var TERM_FIELDS = [
|
|
|
53
53
|
"related-terms",
|
|
54
54
|
"see",
|
|
55
55
|
"scope-note",
|
|
56
|
+
"notation",
|
|
57
|
+
"exact-matches",
|
|
58
|
+
"close-matches",
|
|
59
|
+
"broad-matches",
|
|
60
|
+
"narrow-matches",
|
|
61
|
+
"related-matches",
|
|
56
62
|
"subject-field",
|
|
57
63
|
"contexts",
|
|
58
64
|
"notes",
|
|
@@ -75,6 +81,13 @@ var TERM_LIST_FIELDS = [
|
|
|
75
81
|
"narrower",
|
|
76
82
|
"related-terms"
|
|
77
83
|
];
|
|
84
|
+
var TERM_MATCH_FIELDS = [
|
|
85
|
+
"exact-matches",
|
|
86
|
+
"close-matches",
|
|
87
|
+
"broad-matches",
|
|
88
|
+
"narrow-matches",
|
|
89
|
+
"related-matches"
|
|
90
|
+
];
|
|
78
91
|
var TERM_AUX_FIELDS = [
|
|
79
92
|
"definition",
|
|
80
93
|
"subject-field",
|
|
@@ -112,6 +125,7 @@ var TERM_WRITE_FORMATS = [
|
|
|
112
125
|
"tbx",
|
|
113
126
|
"tbx3",
|
|
114
127
|
"skos",
|
|
128
|
+
"skos-ttl",
|
|
115
129
|
"csv",
|
|
116
130
|
"json",
|
|
117
131
|
"vale"
|
|
@@ -121,12 +135,24 @@ var TERM_RULES = [
|
|
|
121
135
|
"duplicate-id",
|
|
122
136
|
"label-collision",
|
|
123
137
|
"alt-label-collision",
|
|
138
|
+
"label-overlap",
|
|
124
139
|
"dangling-reference",
|
|
125
140
|
"broader-cycle",
|
|
126
141
|
"see-not-empty",
|
|
142
|
+
"missing-definition",
|
|
143
|
+
"conflicting-matches",
|
|
127
144
|
"asymmetric-hierarchy",
|
|
145
|
+
"asymmetric-related",
|
|
146
|
+
"related-in-hierarchy",
|
|
147
|
+
"alt-label-reference",
|
|
148
|
+
"ambiguous-alt-label",
|
|
149
|
+
"deprecated-label",
|
|
128
150
|
"abstract-too-long",
|
|
129
|
-
"unused-term"
|
|
151
|
+
"unused-term",
|
|
152
|
+
"hierarchy-outside-termbase",
|
|
153
|
+
"related-siblings",
|
|
154
|
+
"orphan-term",
|
|
155
|
+
"keyword-candidate"
|
|
130
156
|
];
|
|
131
157
|
|
|
132
158
|
// src/term/core/config.ts
|
|
@@ -140,8 +166,16 @@ var CONFIG_KEYS = [
|
|
|
140
166
|
"baseline",
|
|
141
167
|
"severity",
|
|
142
168
|
"allowEmpty",
|
|
143
|
-
"respectGitignore"
|
|
169
|
+
"respectGitignore",
|
|
170
|
+
"provider",
|
|
171
|
+
"model",
|
|
172
|
+
"fill"
|
|
144
173
|
];
|
|
174
|
+
var FILL_KEYS = ["out", "confidenceThreshold", "maxTurns", "cacheDir", "crawl"];
|
|
175
|
+
var CRAWL_KEYS = ["minPages"];
|
|
176
|
+
var DEFAULT_FILL_CONFIDENCE = 0.7;
|
|
177
|
+
var DEFAULT_FILL_CACHE_DIR = ".manni/term/cache";
|
|
178
|
+
var DEFAULT_CRAWL_MIN_PAGES = 2;
|
|
145
179
|
var COLLECTION_KEYS = ["paths", "exclude"];
|
|
146
180
|
var TOOL_KEYS = ["vale"];
|
|
147
181
|
var SEVERITY_LEVELS = [...SEVERITIES, "off"];
|
|
@@ -191,6 +225,40 @@ function asNonNegativeInteger(value, key, source) {
|
|
|
191
225
|
}
|
|
192
226
|
return value;
|
|
193
227
|
}
|
|
228
|
+
function parseFill(value, source) {
|
|
229
|
+
if (!isMapping(value)) throw wrongType("fill", "a mapping", source);
|
|
230
|
+
rejectUnknownKeys(value, FILL_KEYS, "term.fill", source);
|
|
231
|
+
const fill = {};
|
|
232
|
+
if (value.out !== void 0) fill.out = asString(value.out, "fill.out", source);
|
|
233
|
+
if (value.cacheDir !== void 0) fill.cacheDir = asString(value.cacheDir, "fill.cacheDir", source);
|
|
234
|
+
const threshold = value.confidenceThreshold;
|
|
235
|
+
if (threshold !== void 0) {
|
|
236
|
+
if (typeof threshold !== "number" || !(threshold >= 0 && threshold <= 1)) {
|
|
237
|
+
throw wrongType("fill.confidenceThreshold", "a number from 0 to 1", source);
|
|
238
|
+
}
|
|
239
|
+
fill.confidenceThreshold = threshold;
|
|
240
|
+
}
|
|
241
|
+
const turns = value.maxTurns;
|
|
242
|
+
if (turns !== void 0) {
|
|
243
|
+
if (turns !== null && (typeof turns !== "number" || !Number.isInteger(turns) || turns < 1)) {
|
|
244
|
+
throw wrongType("fill.maxTurns", "a positive integer or null", source);
|
|
245
|
+
}
|
|
246
|
+
fill.maxTurns = turns;
|
|
247
|
+
}
|
|
248
|
+
if (value.crawl !== void 0) {
|
|
249
|
+
if (!isMapping(value.crawl)) throw wrongType("fill.crawl", "a mapping", source);
|
|
250
|
+
rejectUnknownKeys(value.crawl, CRAWL_KEYS, "term.fill.crawl", source);
|
|
251
|
+
const minPages = value.crawl.minPages;
|
|
252
|
+
fill.crawl = {};
|
|
253
|
+
if (minPages !== void 0) {
|
|
254
|
+
if (typeof minPages !== "number" || !Number.isInteger(minPages) || minPages < 1) {
|
|
255
|
+
throw wrongType("fill.crawl.minPages", "a positive integer", source);
|
|
256
|
+
}
|
|
257
|
+
fill.crawl.minPages = minPages;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return fill;
|
|
261
|
+
}
|
|
194
262
|
function parseSeverity(value, source) {
|
|
195
263
|
if (!isMapping(value)) throw wrongType("severity", "a mapping", source);
|
|
196
264
|
rejectUnknownKeys(value, TERM_RULES, "term.severity", source);
|
|
@@ -238,6 +306,9 @@ function parseTermConfig(raw, source) {
|
|
|
238
306
|
if (raw.respectGitignore !== void 0) {
|
|
239
307
|
config.respectGitignore = asBoolean(raw.respectGitignore, "respectGitignore", source);
|
|
240
308
|
}
|
|
309
|
+
if (raw.provider !== void 0) config.provider = asString(raw.provider, "provider", source);
|
|
310
|
+
if (raw.model !== void 0) config.model = asString(raw.model, "model", source);
|
|
311
|
+
if (raw.fill !== void 0) config.fill = parseFill(raw.fill, source);
|
|
241
312
|
return config;
|
|
242
313
|
}
|
|
243
314
|
function readTermConfigFile(explicitPath, cwd) {
|
|
@@ -320,6 +391,8 @@ import { isAbsolute, relative, resolve as resolve3 } from "node:path";
|
|
|
320
391
|
// src/term/core/load-set.ts
|
|
321
392
|
import { readFile } from "node:fs/promises";
|
|
322
393
|
import { extname, resolve as resolve2 } from "node:path";
|
|
394
|
+
import { pathToFileURL } from "node:url";
|
|
395
|
+
import { DataFactory, Writer } from "n3";
|
|
323
396
|
|
|
324
397
|
// src/term/core/writers/markup.ts
|
|
325
398
|
function xmlText(value) {
|
|
@@ -486,6 +559,9 @@ function collapse(text) {
|
|
|
486
559
|
function isListField(field) {
|
|
487
560
|
return TERM_LIST_FIELDS.includes(field);
|
|
488
561
|
}
|
|
562
|
+
function isListOfText(field) {
|
|
563
|
+
return isListField(field) || field === "tbx-markup" || TERM_MATCH_FIELDS.includes(field);
|
|
564
|
+
}
|
|
489
565
|
function isAuxField(field) {
|
|
490
566
|
return TERM_AUX_FIELDS.includes(field);
|
|
491
567
|
}
|
|
@@ -620,7 +696,7 @@ function recordOf(raw, issues) {
|
|
|
620
696
|
for (const field of TERM_FIELDS) {
|
|
621
697
|
const value = raw[field];
|
|
622
698
|
if (field === "label") continue;
|
|
623
|
-
if (
|
|
699
|
+
if (isListOfText(field)) {
|
|
624
700
|
const list = listOf(value);
|
|
625
701
|
if (list !== void 0) record[field] = list;
|
|
626
702
|
} else if (isAuxField(field)) {
|
|
@@ -692,9 +768,9 @@ function indentAt(content, offset) {
|
|
|
692
768
|
const lineStart = content.lastIndexOf("\n", offset - 1) + 1;
|
|
693
769
|
return /^[ \t]*/.exec(content.slice(lineStart, offset))?.[0] ?? "";
|
|
694
770
|
}
|
|
695
|
-
function applyEntries(input,
|
|
771
|
+
function applyEntries(input, read9, terms, write) {
|
|
696
772
|
const { content } = input;
|
|
697
|
-
const current =
|
|
773
|
+
const current = read9(input).terms;
|
|
698
774
|
const eol = lineEnding(content);
|
|
699
775
|
const edits = [];
|
|
700
776
|
for (const term of terms) {
|
|
@@ -900,9 +976,9 @@ function readEntry(input, xml, entry, construct, label) {
|
|
|
900
976
|
function collect(input, xml, entries, construct, label) {
|
|
901
977
|
const result = nothing();
|
|
902
978
|
for (const entry of entries) {
|
|
903
|
-
const
|
|
904
|
-
if (typeof
|
|
905
|
-
else result.terms.push(
|
|
979
|
+
const read9 = readEntry(input, xml, entry, construct, label);
|
|
980
|
+
if (typeof read9 === "string") result.notices.push(read9);
|
|
981
|
+
else result.terms.push(read9);
|
|
906
982
|
}
|
|
907
983
|
return result;
|
|
908
984
|
}
|
|
@@ -1488,6 +1564,173 @@ var pageReader = {
|
|
|
1488
1564
|
apply
|
|
1489
1565
|
};
|
|
1490
1566
|
|
|
1567
|
+
// src/term/core/readers/skos.ts
|
|
1568
|
+
import { Parser } from "n3";
|
|
1569
|
+
var SKOS = "http://www.w3.org/2004/02/skos/core#";
|
|
1570
|
+
var RDF_TYPE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
|
|
1571
|
+
var CONCEPT = `${SKOS}Concept`;
|
|
1572
|
+
var SKOS_PROPERTIES = [
|
|
1573
|
+
{ property: "prefLabel", field: "label", kind: "text" },
|
|
1574
|
+
{ property: "altLabel", field: "alt-labels", kind: "texts" },
|
|
1575
|
+
{ property: "hiddenLabel", field: "hidden-labels", kind: "texts" },
|
|
1576
|
+
{ property: "definition", field: "definition", kind: "text" },
|
|
1577
|
+
{ property: "scopeNote", field: "scope-note", kind: "text" },
|
|
1578
|
+
{ property: "notation", field: "notation", kind: "code" },
|
|
1579
|
+
{ property: "broader", field: "broader", kind: "concepts" },
|
|
1580
|
+
{ property: "narrower", field: "narrower", kind: "concepts" },
|
|
1581
|
+
{ property: "related", field: "related-terms", kind: "concepts" },
|
|
1582
|
+
{ property: "exactMatch", field: "exact-matches", kind: "iris" },
|
|
1583
|
+
{ property: "closeMatch", field: "close-matches", kind: "iris" },
|
|
1584
|
+
{ property: "broadMatch", field: "broad-matches", kind: "iris" },
|
|
1585
|
+
{ property: "narrowMatch", field: "narrow-matches", kind: "iris" },
|
|
1586
|
+
{ property: "relatedMatch", field: "related-matches", kind: "iris" },
|
|
1587
|
+
{ property: "note", field: "notes", kind: "texts" },
|
|
1588
|
+
{ property: "example", field: "contexts", kind: "texts" }
|
|
1589
|
+
];
|
|
1590
|
+
var BY_IRI = new Map(SKOS_PROPERTIES.map((p) => [`${SKOS}${p.property}`, p]));
|
|
1591
|
+
var UNDERSTOOD = /* @__PURE__ */ new Set([RDF_TYPE, `${SKOS}inScheme`, `${SKOS}topConceptOf`]);
|
|
1592
|
+
var PREFIXES = [
|
|
1593
|
+
["skos", SKOS],
|
|
1594
|
+
["rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"],
|
|
1595
|
+
["rdfs", "http://www.w3.org/2000/01/rdf-schema#"],
|
|
1596
|
+
["dcterms", "http://purl.org/dc/terms/"],
|
|
1597
|
+
["owl", "http://www.w3.org/2002/07/owl#"]
|
|
1598
|
+
];
|
|
1599
|
+
var LABEL4 = "SKOS concept";
|
|
1600
|
+
function nameOf2(iri) {
|
|
1601
|
+
for (const [prefix, namespace] of PREFIXES) {
|
|
1602
|
+
if (iri.startsWith(namespace)) return `${prefix}:${iri.slice(namespace.length)}`;
|
|
1603
|
+
}
|
|
1604
|
+
return `<${iri}>`;
|
|
1605
|
+
}
|
|
1606
|
+
function localName(iri) {
|
|
1607
|
+
const tail = iri.slice(Math.max(iri.lastIndexOf("#"), iri.lastIndexOf("/")) + 1);
|
|
1608
|
+
if (tail === "") return void 0;
|
|
1609
|
+
try {
|
|
1610
|
+
return decodeURIComponent(tail);
|
|
1611
|
+
} catch {
|
|
1612
|
+
return tail;
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
var Unread = class {
|
|
1616
|
+
counts = /* @__PURE__ */ new Map();
|
|
1617
|
+
add(reason) {
|
|
1618
|
+
this.counts.set(reason, (this.counts.get(reason) ?? 0) + 1);
|
|
1619
|
+
}
|
|
1620
|
+
notices(file) {
|
|
1621
|
+
return [...this.counts].map(
|
|
1622
|
+
([reason, n]) => `${file}: ${reason}, so ${n === 1 ? "1 value was" : `${String(n)} values were`} not read.`
|
|
1623
|
+
);
|
|
1624
|
+
}
|
|
1625
|
+
};
|
|
1626
|
+
function parse2(input) {
|
|
1627
|
+
try {
|
|
1628
|
+
return new Parser().parse(input.content);
|
|
1629
|
+
} catch (error) {
|
|
1630
|
+
throw new TermError(`${input.file}: could not be read as SKOS: ${errorMessage(error)}`);
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
function concepts(quads) {
|
|
1634
|
+
const typed = new Set(
|
|
1635
|
+
quads.filter((q) => q.predicate.value === RDF_TYPE && q.object.value === CONCEPT).map((q) => q.subject.id)
|
|
1636
|
+
);
|
|
1637
|
+
const found = /* @__PURE__ */ new Map();
|
|
1638
|
+
for (const quad of quads) {
|
|
1639
|
+
if (!typed.has(quad.subject.id)) continue;
|
|
1640
|
+
const entry = found.get(quad.subject.id) ?? { subject: quad.subject, quads: [] };
|
|
1641
|
+
entry.quads.push(quad);
|
|
1642
|
+
found.set(quad.subject.id, entry);
|
|
1643
|
+
}
|
|
1644
|
+
return found;
|
|
1645
|
+
}
|
|
1646
|
+
function append(raw, field, value) {
|
|
1647
|
+
const current = raw[field];
|
|
1648
|
+
raw[field] = Array.isArray(current) ? [...current, value] : [value];
|
|
1649
|
+
}
|
|
1650
|
+
function readConcept(input, subject, quads, unread, notices) {
|
|
1651
|
+
const id = subject.termType === "NamedNode" ? localName(subject.value) : void 0;
|
|
1652
|
+
const name = id ?? subject.value;
|
|
1653
|
+
const languages = /* @__PURE__ */ new Map();
|
|
1654
|
+
for (const quad of quads) {
|
|
1655
|
+
if (quad.predicate.value === `${SKOS}prefLabel` && quad.object.termType === "Literal") {
|
|
1656
|
+
languages.set(quad.object.language, languages.get(quad.object.language) ?? {});
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
if (languages.size === 0) {
|
|
1660
|
+
notices.push(`${input.file}: skipped SKOS concept "${name}", which has no skos:prefLabel.`);
|
|
1661
|
+
return [];
|
|
1662
|
+
}
|
|
1663
|
+
const shared = {};
|
|
1664
|
+
for (const { predicate, object } of quads) {
|
|
1665
|
+
if (UNDERSTOOD.has(predicate.value)) continue;
|
|
1666
|
+
const property = BY_IRI.get(predicate.value);
|
|
1667
|
+
const spelled = nameOf2(predicate.value);
|
|
1668
|
+
if (property === void 0) {
|
|
1669
|
+
unread.add(`${spelled} is not a term field`);
|
|
1670
|
+
continue;
|
|
1671
|
+
}
|
|
1672
|
+
if (property.kind === "concepts" || property.kind === "iris") {
|
|
1673
|
+
if (object.termType === "Literal") {
|
|
1674
|
+
unread.add(`${spelled} on "${name}" is not an IRI`);
|
|
1675
|
+
continue;
|
|
1676
|
+
}
|
|
1677
|
+
const value = property.kind === "concepts" ? localName(object.value) ?? object.value : object.value;
|
|
1678
|
+
append(shared, property.field, value);
|
|
1679
|
+
continue;
|
|
1680
|
+
}
|
|
1681
|
+
if (object.termType !== "Literal") {
|
|
1682
|
+
unread.add(`${spelled} on "${name}" is not text`);
|
|
1683
|
+
continue;
|
|
1684
|
+
}
|
|
1685
|
+
if (property.kind === "code") {
|
|
1686
|
+
if (shared[property.field] === void 0) shared[property.field] = object.value;
|
|
1687
|
+
else unread.add(`"${name}" holds one ${spelled}`);
|
|
1688
|
+
continue;
|
|
1689
|
+
}
|
|
1690
|
+
const language = object.language;
|
|
1691
|
+
const raw = languages.get(language);
|
|
1692
|
+
if (raw === void 0) {
|
|
1693
|
+
unread.add(language === "" ? `"${name}" has no untagged skos:prefLabel` : `"${name}" has no skos:prefLabel in ${language}`);
|
|
1694
|
+
continue;
|
|
1695
|
+
}
|
|
1696
|
+
if (property.kind === "texts") {
|
|
1697
|
+
append(raw, property.field, object.value);
|
|
1698
|
+
} else if (raw[property.field] === void 0) {
|
|
1699
|
+
raw[property.field] = object.value;
|
|
1700
|
+
} else {
|
|
1701
|
+
unread.add(`"${name}" holds one ${spelled} per language`);
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
const terms = [];
|
|
1705
|
+
for (const language of [...languages.keys()].sort()) {
|
|
1706
|
+
const record = recordOf({ ...languages.get(language), ...shared });
|
|
1707
|
+
if (record === void 0) continue;
|
|
1708
|
+
terms.push(
|
|
1709
|
+
termOf(input, { record, recordId: id, construct: "skos", line: 1, lines: {}, language: language === "" ? void 0 : language })
|
|
1710
|
+
);
|
|
1711
|
+
}
|
|
1712
|
+
return terms;
|
|
1713
|
+
}
|
|
1714
|
+
function read4(input) {
|
|
1715
|
+
const unread = new Unread();
|
|
1716
|
+
const notices = [];
|
|
1717
|
+
const entries = [...concepts(parse2(input)).values()].map(({ subject, quads }) => ({
|
|
1718
|
+
subject: subject.value,
|
|
1719
|
+
terms: readConcept(input, subject, quads, unread, notices)
|
|
1720
|
+
}));
|
|
1721
|
+
entries.sort((a, b) => {
|
|
1722
|
+
const [x, y] = [a.terms[0]?.id ?? "", b.terms[0]?.id ?? ""];
|
|
1723
|
+
return x === y ? a.subject < b.subject ? -1 : 1 : x < y ? -1 : 1;
|
|
1724
|
+
});
|
|
1725
|
+
return { terms: entries.flatMap((entry) => entry.terms), notices: [...notices, ...unread.notices(input.file)] };
|
|
1726
|
+
}
|
|
1727
|
+
var skosReader = {
|
|
1728
|
+
construct: "skos",
|
|
1729
|
+
label: LABEL4,
|
|
1730
|
+
formats: ["skos"],
|
|
1731
|
+
read: read4
|
|
1732
|
+
};
|
|
1733
|
+
|
|
1491
1734
|
// src/term/core/readers/tbx.ts
|
|
1492
1735
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
1493
1736
|
import { DOMParser as DOMParser3 } from "@xmldom/xmldom";
|
|
@@ -1792,7 +2035,7 @@ function tbxEntryLines(terms, format, shape) {
|
|
|
1792
2035
|
}
|
|
1793
2036
|
|
|
1794
2037
|
// src/term/core/readers/tbx.ts
|
|
1795
|
-
var
|
|
2038
|
+
var LABEL5 = "TBX entry";
|
|
1796
2039
|
var parsed = /* @__PURE__ */ new WeakMap();
|
|
1797
2040
|
function parseTbx(input) {
|
|
1798
2041
|
const cached = parsed.get(input);
|
|
@@ -2030,13 +2273,13 @@ function statusOf(text) {
|
|
|
2030
2273
|
for (const [status, value] of Object.entries(TBX_STATUS_VALUES)) if (value === text) return status;
|
|
2031
2274
|
return text in TBX_STATUS_VALUES || text === TBX_NO_STATUS ? void 0 : text;
|
|
2032
2275
|
}
|
|
2033
|
-
function readLevel(doc, children, level,
|
|
2034
|
-
let { aux } =
|
|
2276
|
+
function readLevel(doc, children, level, read9) {
|
|
2277
|
+
let { aux } = read9;
|
|
2035
2278
|
const items = [];
|
|
2036
2279
|
const seen = [];
|
|
2037
2280
|
const keep = (value) => {
|
|
2038
2281
|
seen.push(value);
|
|
2039
|
-
if (value.markup !== void 0)
|
|
2282
|
+
if (value.markup !== void 0) read9.markup.push(value.markup);
|
|
2040
2283
|
return value.text;
|
|
2041
2284
|
};
|
|
2042
2285
|
const definitionEl = children.find(
|
|
@@ -2126,12 +2369,12 @@ function readLevel(doc, children, level, read8) {
|
|
|
2126
2369
|
return false;
|
|
2127
2370
|
};
|
|
2128
2371
|
for (const child of children) {
|
|
2129
|
-
const saved =
|
|
2372
|
+
const saved = read9.fits === void 0 ? void 0 : { aux: structuredClone(aux), markup: read9.markup.length };
|
|
2130
2373
|
seen.length = 0;
|
|
2131
|
-
if (mapped(child) && (
|
|
2374
|
+
if (mapped(child) && (read9.fits === void 0 || seen.every(read9.fits))) continue;
|
|
2132
2375
|
if (saved !== void 0) {
|
|
2133
|
-
aux =
|
|
2134
|
-
|
|
2376
|
+
aux = read9.aux = saved.aux;
|
|
2377
|
+
read9.markup.length = saved.markup;
|
|
2135
2378
|
}
|
|
2136
2379
|
items.push(itemOf(doc, child));
|
|
2137
2380
|
}
|
|
@@ -2150,14 +2393,14 @@ function readDesignation(doc, el, fits) {
|
|
|
2150
2393
|
const term = termEl === void 0 ? void 0 : valueOf(doc, termEl, true, true);
|
|
2151
2394
|
const text = termEl === void 0 ? void 0 : textOf(lf(termEl.textContent ?? ""));
|
|
2152
2395
|
if (termEl === void 0 || text === void 0) return void 0;
|
|
2153
|
-
const
|
|
2396
|
+
const read9 = { aux: { term: text }, markup: term?.markup === void 0 ? [] : [term.markup], ...fits === void 0 ? {} : { fits } };
|
|
2154
2397
|
readLevel(
|
|
2155
2398
|
doc,
|
|
2156
2399
|
children.filter((child) => child !== termEl),
|
|
2157
2400
|
"term",
|
|
2158
|
-
|
|
2401
|
+
read9
|
|
2159
2402
|
);
|
|
2160
|
-
const { "administrative-status": status, ...designation } =
|
|
2403
|
+
const { "administrative-status": status, ...designation } = read9.aux;
|
|
2161
2404
|
const shape = {
|
|
2162
2405
|
term: text,
|
|
2163
2406
|
attributes: attributesOf(el),
|
|
@@ -2167,21 +2410,21 @@ function readDesignation(doc, el, fits) {
|
|
|
2167
2410
|
return {
|
|
2168
2411
|
designation,
|
|
2169
2412
|
term: term ?? { text },
|
|
2170
|
-
markup:
|
|
2413
|
+
markup: read9.markup,
|
|
2171
2414
|
status: status ?? TBX_NO_STATUS,
|
|
2172
2415
|
line: lineOfElement(termEl),
|
|
2173
2416
|
shape
|
|
2174
2417
|
};
|
|
2175
2418
|
}
|
|
2176
|
-
function labelsOf2(
|
|
2177
|
-
const preferred =
|
|
2419
|
+
function labelsOf2(read9) {
|
|
2420
|
+
const preferred = read9.findIndex((d) => d.status === "preferred");
|
|
2178
2421
|
const labelAt = preferred === -1 ? 0 : preferred;
|
|
2179
2422
|
const alts = [];
|
|
2180
2423
|
const hiddens = [];
|
|
2181
2424
|
const order = [];
|
|
2182
2425
|
const altOrder = [];
|
|
2183
2426
|
const hiddenOrder = [];
|
|
2184
|
-
const designations =
|
|
2427
|
+
const designations = read9.map((d, i) => {
|
|
2185
2428
|
const { status } = d;
|
|
2186
2429
|
let kind;
|
|
2187
2430
|
if (i === labelAt) kind = "label";
|
|
@@ -2201,7 +2444,7 @@ function labelsOf2(read8) {
|
|
|
2201
2444
|
const reordered = order.some((at, i) => at !== i);
|
|
2202
2445
|
const detailed = designations.some((d) => Object.keys(d).length > 1);
|
|
2203
2446
|
return {
|
|
2204
|
-
label:
|
|
2447
|
+
label: read9[labelAt]?.designation.term ?? "",
|
|
2205
2448
|
alts,
|
|
2206
2449
|
hiddens,
|
|
2207
2450
|
designations: reordered || detailed ? designations : void 0
|
|
@@ -2258,7 +2501,7 @@ function readEntry2(doc, entry, result) {
|
|
|
2258
2501
|
const { term: _none, ...conceptAux } = concept.aux;
|
|
2259
2502
|
const span = spanOfElement(doc.xml, entry);
|
|
2260
2503
|
const rootLanguage = doc.xml.root.getAttribute("xml:lang");
|
|
2261
|
-
const
|
|
2504
|
+
const read9 = [];
|
|
2262
2505
|
let entryId = textOf(entry.getAttribute("id"));
|
|
2263
2506
|
const shape = { attributes: attributesOf(entry, ["id"]), languages: [] };
|
|
2264
2507
|
for (const part of parts.languages) {
|
|
@@ -2298,9 +2541,9 @@ function readEntry2(doc, entry, result) {
|
|
|
2298
2541
|
attributes: attributesOf(langEl, ["xml:lang"]),
|
|
2299
2542
|
designations: designations.map((d) => d.shape)
|
|
2300
2543
|
});
|
|
2301
|
-
|
|
2544
|
+
read9.push(term);
|
|
2302
2545
|
}
|
|
2303
|
-
result.terms.push(...
|
|
2546
|
+
result.terms.push(...read9);
|
|
2304
2547
|
}
|
|
2305
2548
|
function readTbx(input) {
|
|
2306
2549
|
const doc = parseTbx(input);
|
|
@@ -2387,17 +2630,17 @@ function spliceEntries(input, terms, exporting) {
|
|
|
2387
2630
|
function withEditedConcept(written, current) {
|
|
2388
2631
|
const [head, ...rest] = written;
|
|
2389
2632
|
if (head === void 0) return { terms: written, conflicts: [] };
|
|
2390
|
-
const
|
|
2391
|
-
const
|
|
2392
|
-
const edits = (concept2) => TERM_AUX_FIELDS.filter((field) => !isDeepStrictEqual2(concept2[field],
|
|
2633
|
+
const read9 = current[0]?.record["concept-entry"] ?? {};
|
|
2634
|
+
const concepts2 = written.map((t) => t.record["concept-entry"] ?? {});
|
|
2635
|
+
const edits = (concept2) => TERM_AUX_FIELDS.filter((field) => !isDeepStrictEqual2(concept2[field], read9[field]));
|
|
2393
2636
|
const { conflicts } = mergeFirst(
|
|
2394
2637
|
head.id,
|
|
2395
|
-
|
|
2638
|
+
concepts2.map((c) => Object.fromEntries(edits(c).map((field) => [field, { value: c[field] }]))),
|
|
2396
2639
|
"concept-entry."
|
|
2397
2640
|
);
|
|
2398
2641
|
const concept = {};
|
|
2399
2642
|
for (const field of TERM_AUX_FIELDS) {
|
|
2400
|
-
copyField(concept,
|
|
2643
|
+
copyField(concept, concepts2.find((c) => edits(c).includes(field)) ?? read9, field);
|
|
2401
2644
|
}
|
|
2402
2645
|
const { "concept-entry": _old, ...record } = head.record;
|
|
2403
2646
|
const joined = Object.keys(concept).length === 0 ? record : { ...record, "concept-entry": concept };
|
|
@@ -2416,7 +2659,7 @@ function merge(current, given) {
|
|
|
2416
2659
|
}
|
|
2417
2660
|
var tbxEntryReader = {
|
|
2418
2661
|
construct: "tbx-entry",
|
|
2419
|
-
label:
|
|
2662
|
+
label: LABEL5,
|
|
2420
2663
|
formats: ["tbx"],
|
|
2421
2664
|
read: readTbx,
|
|
2422
2665
|
apply: applyTbx
|
|
@@ -2431,7 +2674,8 @@ var STRUCTURED_READERS = [
|
|
|
2431
2674
|
docbookGlossaryReader,
|
|
2432
2675
|
htmlDlReader,
|
|
2433
2676
|
htmlDfnReader,
|
|
2434
|
-
tbxEntryReader
|
|
2677
|
+
tbxEntryReader,
|
|
2678
|
+
skosReader
|
|
2435
2679
|
];
|
|
2436
2680
|
|
|
2437
2681
|
// src/term/core/readers/body.ts
|
|
@@ -2512,7 +2756,7 @@ function skippedNotice(input, line, label, missing) {
|
|
|
2512
2756
|
}
|
|
2513
2757
|
|
|
2514
2758
|
// src/term/core/readers/asciidoc-glossary.ts
|
|
2515
|
-
var
|
|
2759
|
+
var LABEL6 = "[glossary] list";
|
|
2516
2760
|
var ATTRIBUTE = /^\[glossary\][ \t]*$/;
|
|
2517
2761
|
var ITEM = /^[ \t]*(.*?[^:\s])::(?:[ \t]+(.*))?$/;
|
|
2518
2762
|
var BLOCK_TITLE = /^\.[^.\s]/;
|
|
@@ -2524,7 +2768,7 @@ function item(line) {
|
|
|
2524
2768
|
const text = match[2]?.trim();
|
|
2525
2769
|
return { term, text: text === "" ? void 0 : text };
|
|
2526
2770
|
}
|
|
2527
|
-
function
|
|
2771
|
+
function read5(input) {
|
|
2528
2772
|
const terms = [];
|
|
2529
2773
|
const notices = [];
|
|
2530
2774
|
const lines = bodyLines(input);
|
|
@@ -2561,13 +2805,13 @@ function readList(input, lines, at, terms, notices) {
|
|
|
2561
2805
|
})
|
|
2562
2806
|
);
|
|
2563
2807
|
} else if (firstLabel !== void 0) {
|
|
2564
|
-
notices.push(skippedNotice(input, firstLabel.line,
|
|
2808
|
+
notices.push(skippedNotice(input, firstLabel.line, LABEL6, "definition"));
|
|
2565
2809
|
}
|
|
2566
2810
|
open = void 0;
|
|
2567
2811
|
}
|
|
2568
2812
|
const [firstPending] = pending;
|
|
2569
2813
|
if (firstPending !== void 0) {
|
|
2570
|
-
notices.push(skippedNotice(input, firstPending.line,
|
|
2814
|
+
notices.push(skippedNotice(input, firstPending.line, LABEL6, "definition"));
|
|
2571
2815
|
pending = [];
|
|
2572
2816
|
}
|
|
2573
2817
|
};
|
|
@@ -2619,14 +2863,14 @@ function itemTerm(line) {
|
|
|
2619
2863
|
}
|
|
2620
2864
|
var asciidocGlossaryReader = {
|
|
2621
2865
|
construct: "asciidoc-glossary",
|
|
2622
|
-
label:
|
|
2866
|
+
label: LABEL6,
|
|
2623
2867
|
formats: ["asciidoc"],
|
|
2624
|
-
read:
|
|
2625
|
-
apply: (input, terms) => applyEntries(input,
|
|
2868
|
+
read: read5,
|
|
2869
|
+
apply: (input, terms) => applyEntries(input, read5, terms, { holds: LIST_HOLDS, id: false, serialize: (term) => asciidocEntry(term.record) })
|
|
2626
2870
|
};
|
|
2627
2871
|
|
|
2628
2872
|
// src/term/core/readers/markdown-deflist.ts
|
|
2629
|
-
var
|
|
2873
|
+
var LABEL7 = "definition list";
|
|
2630
2874
|
var DEFINITION = /^:(?:[ \t]+(.*))?$/;
|
|
2631
2875
|
var INDENTED = /^(?: {4}|\t)/;
|
|
2632
2876
|
var HEADING = /^#{1,6}(?:[ \t]|$)/;
|
|
@@ -2635,7 +2879,7 @@ function definitionStart(line) {
|
|
|
2635
2879
|
const match = DEFINITION.exec(line.text);
|
|
2636
2880
|
return match === null ? void 0 : match[1] ?? "";
|
|
2637
2881
|
}
|
|
2638
|
-
function
|
|
2882
|
+
function read6(input) {
|
|
2639
2883
|
const terms = [];
|
|
2640
2884
|
const notices = [];
|
|
2641
2885
|
if (input.metadata["type"] !== "term-set") return { terms, notices };
|
|
@@ -2663,7 +2907,7 @@ function read5(input) {
|
|
|
2663
2907
|
}
|
|
2664
2908
|
if (labels.length === 0 || labels.some((l) => HEADING.test(l.text))) {
|
|
2665
2909
|
const orphan = lines[j];
|
|
2666
|
-
if (orphan !== void 0) notices.push(skippedNotice(input, orphan.line,
|
|
2910
|
+
if (orphan !== void 0) notices.push(skippedNotice(input, orphan.line, LABEL7, "term"));
|
|
2667
2911
|
i = readDefinitions(lines, j, []);
|
|
2668
2912
|
continue;
|
|
2669
2913
|
}
|
|
@@ -2674,7 +2918,7 @@ function read5(input) {
|
|
|
2674
2918
|
if (firstLabel === void 0 || kept === void 0) continue;
|
|
2675
2919
|
const text = definitionText(kept.paragraphs);
|
|
2676
2920
|
if (text === void 0) {
|
|
2677
|
-
notices.push(skippedNotice(input, firstLabel.line,
|
|
2921
|
+
notices.push(skippedNotice(input, firstLabel.line, LABEL7, "definition"));
|
|
2678
2922
|
continue;
|
|
2679
2923
|
}
|
|
2680
2924
|
for (const extra of definitions.slice(1)) {
|
|
@@ -2735,14 +2979,14 @@ function readDefinitions(lines, at, out) {
|
|
|
2735
2979
|
}
|
|
2736
2980
|
var markdownDeflistReader = {
|
|
2737
2981
|
construct: "markdown-deflist",
|
|
2738
|
-
label:
|
|
2982
|
+
label: LABEL7,
|
|
2739
2983
|
formats: ["markdown", "mdx"],
|
|
2740
|
-
read:
|
|
2741
|
-
apply: (input, terms) => applyEntries(input,
|
|
2984
|
+
read: read6,
|
|
2985
|
+
apply: (input, terms) => applyEntries(input, read6, terms, { holds: LIST_HOLDS, id: false, serialize: (term) => markdownEntry(term.record) })
|
|
2742
2986
|
};
|
|
2743
2987
|
|
|
2744
2988
|
// src/term/core/readers/rst-glossary.ts
|
|
2745
|
-
var
|
|
2989
|
+
var LABEL8 = ".. glossary::";
|
|
2746
2990
|
var DIRECTIVE = /^[ \t]*\.\.[ \t]+glossary::[ \t]*$/;
|
|
2747
2991
|
var CODE_DIRECTIVE = /^[ \t]*\.\.[ \t]+(?:code-block|code|sourcecode)::/;
|
|
2748
2992
|
var EXPLICIT_MARKUP = /^[ \t]*\.\.(?:[ \t]|$)/;
|
|
@@ -2761,7 +3005,7 @@ function opensLiteral(line) {
|
|
|
2761
3005
|
if (CODE_DIRECTIVE.test(line.text)) return true;
|
|
2762
3006
|
return !EXPLICIT_MARKUP.test(line.text) && line.text.trimEnd().endsWith("::");
|
|
2763
3007
|
}
|
|
2764
|
-
function
|
|
3008
|
+
function read7(input) {
|
|
2765
3009
|
const terms = [];
|
|
2766
3010
|
const notices = [];
|
|
2767
3011
|
const lines = bodyLines(input);
|
|
@@ -2811,7 +3055,7 @@ function readGlossary(input, lines, at, terms, notices) {
|
|
|
2811
3055
|
})
|
|
2812
3056
|
);
|
|
2813
3057
|
} else {
|
|
2814
|
-
notices.push(skippedNotice(input, first.line,
|
|
3058
|
+
notices.push(skippedNotice(input, first.line, LABEL8, "definition"));
|
|
2815
3059
|
}
|
|
2816
3060
|
}
|
|
2817
3061
|
labels = [];
|
|
@@ -2846,7 +3090,7 @@ function readGlossary(input, lines, at, terms, notices) {
|
|
|
2846
3090
|
} else if (labels.length > 0) {
|
|
2847
3091
|
definition = { line: line.line, paragraphs: [[line.text]], last: line, gap: false };
|
|
2848
3092
|
} else if (!orphan) {
|
|
2849
|
-
notices.push(skippedNotice(input, line.line,
|
|
3093
|
+
notices.push(skippedNotice(input, line.line, LABEL8, "term"));
|
|
2850
3094
|
orphan = true;
|
|
2851
3095
|
}
|
|
2852
3096
|
}
|
|
@@ -2860,10 +3104,10 @@ function termText(line) {
|
|
|
2860
3104
|
}
|
|
2861
3105
|
var rstGlossaryReader = {
|
|
2862
3106
|
construct: "rst-glossary",
|
|
2863
|
-
label:
|
|
3107
|
+
label: LABEL8,
|
|
2864
3108
|
formats: ["rst"],
|
|
2865
|
-
read:
|
|
2866
|
-
apply: (input, terms) => applyEntries(input,
|
|
3109
|
+
read: read7,
|
|
3110
|
+
apply: (input, terms) => applyEntries(input, read7, terms, { holds: LIST_HOLDS, id: false, serialize: (term) => rstEntry(term.record) })
|
|
2867
3111
|
};
|
|
2868
3112
|
|
|
2869
3113
|
// src/term/core/readers/text.ts
|
|
@@ -2890,6 +3134,74 @@ var TBX_EXTENSION = ".tbx";
|
|
|
2890
3134
|
function tbxInput(content, file, path) {
|
|
2891
3135
|
return { content, file, ...path === void 0 ? {} : { path }, format: TBX_FORMAT, metadata: {}, lineFor: () => void 0 };
|
|
2892
3136
|
}
|
|
3137
|
+
var SKOS_FORMAT = "skos";
|
|
3138
|
+
var SKOS_EXTENSIONS = /* @__PURE__ */ new Set([".ttl", ".jsonld"]);
|
|
3139
|
+
function isSkos(file) {
|
|
3140
|
+
return SKOS_EXTENSIONS.has(extname(file).toLowerCase());
|
|
3141
|
+
}
|
|
3142
|
+
var XSD_STRING = "http://www.w3.org/2001/XMLSchema#string";
|
|
3143
|
+
async function jsonLdToNQuads(content, file, path, parsed2) {
|
|
3144
|
+
let document = parsed2;
|
|
3145
|
+
if (document === void 0) {
|
|
3146
|
+
try {
|
|
3147
|
+
document = JSON.parse(content);
|
|
3148
|
+
} catch (error) {
|
|
3149
|
+
throw new TermError(`${file}: could not be read as SKOS: ${errorMessage(error)}`);
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
3152
|
+
const { default: jsonld } = await import("jsonld");
|
|
3153
|
+
let remote;
|
|
3154
|
+
let dataset;
|
|
3155
|
+
try {
|
|
3156
|
+
dataset = await jsonld.toRDF(document, {
|
|
3157
|
+
base: pathToFileURL(path ?? resolve2(file)).href,
|
|
3158
|
+
documentLoader: (url) => {
|
|
3159
|
+
remote = url;
|
|
3160
|
+
return Promise.reject(new Error(`${url} is not fetched`));
|
|
3161
|
+
}
|
|
3162
|
+
});
|
|
3163
|
+
} catch (error) {
|
|
3164
|
+
if (remote !== void 0) {
|
|
3165
|
+
throw new TermError(
|
|
3166
|
+
`${file}: names the remote @context ${remote}, which is not fetched. Inline the context to read it.`
|
|
3167
|
+
);
|
|
3168
|
+
}
|
|
3169
|
+
throw new TermError(`${file}: could not be read as SKOS: ${errorMessage(error)}`);
|
|
3170
|
+
}
|
|
3171
|
+
const node = (t) => t.termType === "BlankNode" ? DataFactory.blankNode(t.value.replace(/^_:/, "")) : DataFactory.namedNode(t.value);
|
|
3172
|
+
const literal = (t) => DataFactory.literal(
|
|
3173
|
+
t.value,
|
|
3174
|
+
t.language !== void 0 && t.language !== "" ? t.language : DataFactory.namedNode(t.datatype?.value ?? XSD_STRING)
|
|
3175
|
+
);
|
|
3176
|
+
const quads = dataset.map(
|
|
3177
|
+
(q) => DataFactory.quad(
|
|
3178
|
+
node(q.subject),
|
|
3179
|
+
DataFactory.namedNode(q.predicate.value),
|
|
3180
|
+
q.object.termType === "Literal" ? literal(q.object) : node(q.object)
|
|
3181
|
+
)
|
|
3182
|
+
);
|
|
3183
|
+
return new Writer({ format: "N-Quads" }).quadsToString(quads);
|
|
3184
|
+
}
|
|
3185
|
+
function parseJson(content) {
|
|
3186
|
+
try {
|
|
3187
|
+
return JSON.parse(content);
|
|
3188
|
+
} catch {
|
|
3189
|
+
return void 0;
|
|
3190
|
+
}
|
|
3191
|
+
}
|
|
3192
|
+
async function skosInput(content, file, path) {
|
|
3193
|
+
const ext = extname(file).toLowerCase();
|
|
3194
|
+
const parsed2 = ext === ".ttl" ? void 0 : parseJson(content);
|
|
3195
|
+
const jsonLd = ext === ".jsonld" || parsed2 !== void 0;
|
|
3196
|
+
return {
|
|
3197
|
+
content: jsonLd ? await jsonLdToNQuads(content, file, path, parsed2) : content,
|
|
3198
|
+
file,
|
|
3199
|
+
...path === void 0 ? {} : { path },
|
|
3200
|
+
format: SKOS_FORMAT,
|
|
3201
|
+
metadata: {},
|
|
3202
|
+
lineFor: () => void 0
|
|
3203
|
+
};
|
|
3204
|
+
}
|
|
2893
3205
|
function defaultExtensions() {
|
|
2894
3206
|
return [...supportedExtensions(), TBX_EXTENSION];
|
|
2895
3207
|
}
|
|
@@ -2903,18 +3215,72 @@ function labelsOf3(value) {
|
|
|
2903
3215
|
}
|
|
2904
3216
|
return [];
|
|
2905
3217
|
}
|
|
3218
|
+
function languageOf3(input) {
|
|
3219
|
+
const language = input.metadata["language"];
|
|
3220
|
+
return typeof language === "string" && language !== "" ? { language } : {};
|
|
3221
|
+
}
|
|
3222
|
+
function lineAt(input, path) {
|
|
3223
|
+
const line = input.lineFor(fieldPointer(path));
|
|
3224
|
+
return line === void 0 ? {} : { line };
|
|
3225
|
+
}
|
|
2906
3226
|
function referencesOf(input) {
|
|
2907
3227
|
const references = [];
|
|
2908
|
-
const
|
|
2909
|
-
for (const label of labelsOf3(
|
|
2910
|
-
|
|
2911
|
-
|
|
3228
|
+
for (const path of CONCEPT_FIELDS) {
|
|
3229
|
+
for (const label of labelsOf3(valueAt(input.metadata, path))) {
|
|
3230
|
+
references.push({
|
|
3231
|
+
file: input.file,
|
|
3232
|
+
label,
|
|
3233
|
+
...lineAt(input, path),
|
|
3234
|
+
...path.length > 1 ? { field: path.join(".") } : {},
|
|
3235
|
+
...languageOf3(input)
|
|
3236
|
+
});
|
|
2912
3237
|
}
|
|
2913
|
-
}
|
|
2914
|
-
for (const path of CONCEPT_FIELDS) add(valueAt(input.metadata, path), fieldPointer(path));
|
|
3238
|
+
}
|
|
2915
3239
|
return references;
|
|
2916
3240
|
}
|
|
2917
|
-
|
|
3241
|
+
var BLOCK_HIERARCHY_FIELDS = ["broader", "narrower", "related-concepts"];
|
|
3242
|
+
function blocksOf(input) {
|
|
3243
|
+
const label = valueAt(input.metadata, ["graph", "label"]);
|
|
3244
|
+
if (typeof label !== "string" || label.trim() === "") return [];
|
|
3245
|
+
const edges = BLOCK_HIERARCHY_FIELDS.flatMap(
|
|
3246
|
+
(field) => labelsOf3(valueAt(input.metadata, ["graph", field])).map((value) => ({
|
|
3247
|
+
field,
|
|
3248
|
+
value,
|
|
3249
|
+
...lineAt(input, ["graph", field])
|
|
3250
|
+
}))
|
|
3251
|
+
);
|
|
3252
|
+
const altLabels = labelsOf3(valueAt(input.metadata, ["graph", "alt-labels"]));
|
|
3253
|
+
const definition = valueAt(input.metadata, ["graph", "definition"]);
|
|
3254
|
+
return [
|
|
3255
|
+
{
|
|
3256
|
+
file: input.file,
|
|
3257
|
+
...lineAt(input, ["graph"]),
|
|
3258
|
+
...languageOf3(input),
|
|
3259
|
+
label,
|
|
3260
|
+
edges,
|
|
3261
|
+
...altLabels.length > 0 ? { altLabels } : {},
|
|
3262
|
+
...typeof definition === "string" && definition.trim() !== "" ? { definition } : {}
|
|
3263
|
+
}
|
|
3264
|
+
];
|
|
3265
|
+
}
|
|
3266
|
+
function keywordsOf(input) {
|
|
3267
|
+
const type = input.metadata["type"];
|
|
3268
|
+
if (type === "term" || type === "term-set") return [];
|
|
3269
|
+
return labelsOf3(input.metadata["keywords"]).map((label) => ({
|
|
3270
|
+
file: input.file,
|
|
3271
|
+
...lineAt(input, ["keywords"]),
|
|
3272
|
+
label,
|
|
3273
|
+
field: "keywords",
|
|
3274
|
+
...languageOf3(input)
|
|
3275
|
+
}));
|
|
3276
|
+
}
|
|
3277
|
+
function pageFacts(input, set, onPage) {
|
|
3278
|
+
set.references.push(...referencesOf(input));
|
|
3279
|
+
set.blocks.push(...blocksOf(input));
|
|
3280
|
+
(set.keywords ??= []).push(...keywordsOf(input));
|
|
3281
|
+
onPage?.(input);
|
|
3282
|
+
}
|
|
3283
|
+
function read8(input, readers, set) {
|
|
2918
3284
|
for (const reader of readersForFormat(input.format, readers)) {
|
|
2919
3285
|
const result = reader.read(input);
|
|
2920
3286
|
set.terms.push(...result.terms);
|
|
@@ -2963,7 +3329,7 @@ async function loadTermSet(opts) {
|
|
|
2963
3329
|
"No files to read. Pass paths/globs, or declare a collection under `collections:` in manni.config.yaml."
|
|
2964
3330
|
);
|
|
2965
3331
|
}
|
|
2966
|
-
const set = { terms: [], references: [], notices: [] };
|
|
3332
|
+
const set = { terms: [], references: [], blocks: [], keywords: [], notices: [] };
|
|
2967
3333
|
if (inputs.length > 0) {
|
|
2968
3334
|
const { files, gitignoreSkipped, named } = await resolveTargetSet({
|
|
2969
3335
|
inputs,
|
|
@@ -2991,11 +3357,15 @@ async function loadTermSet(opts) {
|
|
|
2991
3357
|
for (const file of files) {
|
|
2992
3358
|
const path = resolve2(run.base, file);
|
|
2993
3359
|
if (namedFiles.has(file) && MANIFEST_EXTENSIONS.has(extname(file).toLowerCase())) {
|
|
2994
|
-
|
|
3360
|
+
read8(manifestInput(await readInput(path, file), file, path), readers, set);
|
|
3361
|
+
continue;
|
|
3362
|
+
}
|
|
3363
|
+
if (namedFiles.has(file) && isSkos(file)) {
|
|
3364
|
+
read8(await skosInput(await readInput(path, file), file, path), readers, set);
|
|
2995
3365
|
continue;
|
|
2996
3366
|
}
|
|
2997
3367
|
if (extname(file).toLowerCase() === TBX_EXTENSION) {
|
|
2998
|
-
|
|
3368
|
+
read8(tbxInput(await readInput(path, file), file, path), readers, set);
|
|
2999
3369
|
continue;
|
|
3000
3370
|
}
|
|
3001
3371
|
const extractor = extractorForExtension(extname(file));
|
|
@@ -3003,14 +3373,16 @@ async function loadTermSet(opts) {
|
|
|
3003
3373
|
throw new TermError(`${file}: no reader for its extension. Pass --as <format> through stdin to read it.`);
|
|
3004
3374
|
}
|
|
3005
3375
|
const input = extractInput(await readInput(path, file), file, path, extractor.name);
|
|
3006
|
-
set.
|
|
3007
|
-
|
|
3376
|
+
pageFacts(input, set, opts.onPage);
|
|
3377
|
+
read8(input, readers, set);
|
|
3008
3378
|
}
|
|
3009
3379
|
}
|
|
3010
|
-
if (usingStdin && opts.as
|
|
3380
|
+
if (usingStdin && opts.as?.toLowerCase() === SKOS_FORMAT) {
|
|
3381
|
+
read8(await skosInput(opts.stdin ?? "", STDIN_LABEL), readers, set);
|
|
3382
|
+
} else if (usingStdin && opts.as !== void 0) {
|
|
3011
3383
|
const input = opts.as.toLowerCase() === TBX_FORMAT ? tbxInput(opts.stdin ?? "", STDIN_LABEL) : extractInput(opts.stdin ?? "", STDIN_LABEL, void 0, opts.as);
|
|
3012
|
-
set.
|
|
3013
|
-
|
|
3384
|
+
pageFacts(input, set, opts.onPage);
|
|
3385
|
+
read8(input, readers, set);
|
|
3014
3386
|
}
|
|
3015
3387
|
for (const { path, written } of run.manifests) {
|
|
3016
3388
|
let content;
|
|
@@ -3020,8 +3392,12 @@ async function loadTermSet(opts) {
|
|
|
3020
3392
|
const source = run.configSource ?? "manni.config.yaml";
|
|
3021
3393
|
throw new TermError(`${source}: term.manifests "${written}" does not exist.`);
|
|
3022
3394
|
}
|
|
3395
|
+
if (isSkos(path)) {
|
|
3396
|
+
read8(await skosInput(content, path, path), readers, set);
|
|
3397
|
+
continue;
|
|
3398
|
+
}
|
|
3023
3399
|
const isTbx = extname(path).toLowerCase() === TBX_EXTENSION;
|
|
3024
|
-
|
|
3400
|
+
read8(isTbx ? tbxInput(content, path, path) : manifestInput(content, path, path), readers, set);
|
|
3025
3401
|
}
|
|
3026
3402
|
if (set.terms.length === 0 && !allowEmpty) {
|
|
3027
3403
|
throw new TermError(
|
|
@@ -3059,7 +3435,8 @@ async function loadSet(run, opts) {
|
|
|
3059
3435
|
...opts.stdin === void 0 ? {} : { stdin: opts.stdin },
|
|
3060
3436
|
...opts.as === void 0 ? {} : { as: opts.as },
|
|
3061
3437
|
...opts.onNotice === void 0 ? {} : { onNotice: opts.onNotice },
|
|
3062
|
-
...opts.readers === void 0 ? {} : { readers: opts.readers }
|
|
3438
|
+
...opts.readers === void 0 ? {} : { readers: opts.readers },
|
|
3439
|
+
...opts.onPage === void 0 ? {} : { onPage: opts.onPage }
|
|
3063
3440
|
});
|
|
3064
3441
|
for (const message of set.notices) opts.onNotice?.(message);
|
|
3065
3442
|
return set;
|
|
@@ -3092,19 +3469,17 @@ function plural(n, one, many = `${one}s`) {
|
|
|
3092
3469
|
export {
|
|
3093
3470
|
TermError,
|
|
3094
3471
|
TERM_FIELDS,
|
|
3472
|
+
TERM_MATCH_FIELDS,
|
|
3095
3473
|
TERM_AUX_FIELDS,
|
|
3096
3474
|
TERM_DESIGNATION_FIELDS,
|
|
3097
3475
|
TERM_WRITE_FORMATS,
|
|
3098
3476
|
TERM_RULES,
|
|
3099
3477
|
DEFAULT_TERM_BASELINE_PATH,
|
|
3100
3478
|
DEFAULT_ABSTRACT_MAX_LENGTH,
|
|
3479
|
+
DEFAULT_FILL_CONFIDENCE,
|
|
3480
|
+
DEFAULT_FILL_CACHE_DIR,
|
|
3481
|
+
DEFAULT_CRAWL_MIN_PAGES,
|
|
3101
3482
|
resolveTermRun,
|
|
3102
|
-
DEFAULT_LANGUAGE,
|
|
3103
|
-
languageOf,
|
|
3104
|
-
languageKey,
|
|
3105
|
-
isMultilingual,
|
|
3106
|
-
droppedFields,
|
|
3107
|
-
requireShape,
|
|
3108
3483
|
xmlText,
|
|
3109
3484
|
xmlAttribute,
|
|
3110
3485
|
sharedLanguage,
|
|
@@ -3119,8 +3494,17 @@ export {
|
|
|
3119
3494
|
htmlDlEntry,
|
|
3120
3495
|
ditaEntry,
|
|
3121
3496
|
docbookEntry,
|
|
3497
|
+
slugOf,
|
|
3498
|
+
SKOS,
|
|
3499
|
+
SKOS_PROPERTIES,
|
|
3122
3500
|
conceptGroups,
|
|
3123
3501
|
mergeFirst,
|
|
3502
|
+
DEFAULT_LANGUAGE,
|
|
3503
|
+
languageOf,
|
|
3504
|
+
languageKey,
|
|
3505
|
+
isMultilingual,
|
|
3506
|
+
droppedFields,
|
|
3507
|
+
requireShape,
|
|
3124
3508
|
TBX_V3_NAMESPACE,
|
|
3125
3509
|
tbxSourceOf,
|
|
3126
3510
|
lf,
|
|
@@ -3138,4 +3522,4 @@ export {
|
|
|
3138
3522
|
valeConfigFor,
|
|
3139
3523
|
plural
|
|
3140
3524
|
};
|
|
3141
|
-
//# sourceMappingURL=chunk-
|
|
3525
|
+
//# sourceMappingURL=chunk-FKAZUZQU.js.map
|