proskomma-core 0.9.17 → 0.9.19
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/dist/bundle.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/module.mjs +15888 -0
- package/index.cjs +1 -1
- package/package.json +25 -40
- package/esm/package.json +0 -3
- package/esm/wrapper.mjs +0 -7
- package/informations/meeting_01_march_2023.md +0 -38
- package/scriptlike/blocksSpec.cjs +0 -192
- package/scriptlike/dodson_lexicon.xsl +0 -19
- package/scriptlike/dodson_lexicon_to_entries.cjs +0 -85
- package/scriptlike/open_scriptures_hebrew_lexicon.xsl +0 -28
- package/scriptlike/open_scriptures_hebrew_lexicon_to_entries.cjs +0 -85
- package/src/graph/index.cjs +0 -201
- package/src/graph/lib/do_cv.cjs +0 -249
- package/src/graph/lib/dump.cjs +0 -40
- package/src/graph/lib/remake_blocks.cjs +0 -57
- package/src/graph/lib/sequence_chars.cjs +0 -84
- package/src/graph/lib/sort.cjs +0 -39
- package/src/graph/lib/tribos.cjs +0 -97
- package/src/graph/lib/tribos_expression.cjs +0 -556
- package/src/graph/lib/tribos_ohm_UNUSED.cjs +0 -37
- package/src/graph/lib/tribos_step.cjs +0 -434
- package/src/graph/mutations/add.cjs +0 -91
- package/src/graph/mutations/delete.cjs +0 -61
- package/src/graph/mutations/index.cjs +0 -54
- package/src/graph/mutations/rehash.cjs +0 -17
- package/src/graph/mutations/tags.cjs +0 -120
- package/src/graph/mutations/update.cjs +0 -210
- package/src/graph/mutations/versification.cjs +0 -96
- package/src/graph/queries/block.cjs +0 -228
- package/src/graph/queries/cIndex.cjs +0 -87
- package/src/graph/queries/cell.cjs +0 -42
- package/src/graph/queries/cv.cjs +0 -19
- package/src/graph/queries/cvBook.cjs +0 -16
- package/src/graph/queries/cvChapter.cjs +0 -16
- package/src/graph/queries/cvIndex.cjs +0 -47
- package/src/graph/queries/cvNavigation.cjs +0 -116
- package/src/graph/queries/cvVerseElement.cjs +0 -84
- package/src/graph/queries/cvVerses.cjs +0 -14
- package/src/graph/queries/doc_set.cjs +0 -220
- package/src/graph/queries/document.cjs +0 -555
- package/src/graph/queries/idParts.cjs +0 -30
- package/src/graph/queries/index.cjs +0 -151
- package/src/graph/queries/inputBlockSpec.cjs +0 -17
- package/src/graph/queries/inputItemObject.cjs +0 -12
- package/src/graph/queries/input_att_spec.cjs +0 -14
- package/src/graph/queries/input_key_matches.cjs +0 -11
- package/src/graph/queries/input_key_value.cjs +0 -11
- package/src/graph/queries/input_key_values.cjs +0 -11
- package/src/graph/queries/input_selector_spec.cjs +0 -19
- package/src/graph/queries/item.cjs +0 -71
- package/src/graph/queries/itemGroup.cjs +0 -75
- package/src/graph/queries/key_value.cjs +0 -18
- package/src/graph/queries/kv_entry.cjs +0 -21
- package/src/graph/queries/kv_sequence.cjs +0 -151
- package/src/graph/queries/node.cjs +0 -44
- package/src/graph/queries/orig.cjs +0 -11
- package/src/graph/queries/regex_index.cjs +0 -18
- package/src/graph/queries/row_equals_spec.cjs +0 -11
- package/src/graph/queries/row_match_spec.cjs +0 -11
- package/src/graph/queries/selector_spec.cjs +0 -29
- package/src/graph/queries/sequence.cjs +0 -314
- package/src/graph/queries/table_sequence.cjs +0 -192
- package/src/graph/queries/tree_sequence.cjs +0 -58
- package/src/graph/queries/verseNumber.cjs +0 -44
- package/src/graph/queries/verseRange.cjs +0 -11
- package/src/graph/queries/versification.cjs +0 -25
- package/src/index.cjs +0 -583
- package/src/model/doc_set.cjs +0 -389
- package/src/model/doc_set_helpers/block.cjs +0 -232
- package/src/model/doc_set_helpers/enum.cjs +0 -87
- package/src/model/doc_set_helpers/item.cjs +0 -198
- package/src/model/doc_set_helpers/rehash.cjs +0 -53
- package/src/model/doc_set_helpers/selectors.cjs +0 -58
- package/src/model/doc_set_helpers/serialize.cjs +0 -22
- package/src/model/doc_set_helpers/unsuccinctify.cjs +0 -288
- package/src/model/doc_set_helpers/update.cjs +0 -290
- package/src/model/document.cjs +0 -369
- package/src/model/document_helpers/blocks.cjs +0 -135
- package/src/model/document_helpers/chapter_verse.cjs +0 -291
- package/src/model/document_helpers/pre_enums.cjs +0 -67
- package/src/model/document_helpers/sequences.cjs +0 -205
- package/src/model/document_helpers/serialize_succinct.cjs +0 -55
- package/src/model/document_helpers/succinct_filter.cjs +0 -102
- package/src/model/versifications/eng_vrs.cjs +0 -455
- package/src/model/versifications/index.cjs +0 -38
- package/src/model/versifications/lxx_vrs.cjs +0 -950
- package/src/model/versifications/org_vrs.cjs +0 -155
- package/src/model/versifications/rsc_vrs.cjs +0 -342
- package/src/model/versifications/rso_vrs.cjs +0 -541
- package/src/model/versifications/vul_vrs.cjs +0 -835
- package/src/parser/index.cjs +0 -504
- package/src/parser/lexers/index.cjs +0 -11
- package/src/parser/lexers/lexingRegexes.cjs +0 -45
- package/src/parser/lexers/nodes.cjs +0 -123
- package/src/parser/lexers/object_for_fragment.cjs +0 -123
- package/src/parser/lexers/tsv.cjs +0 -45
- package/src/parser/lexers/usfm.cjs +0 -17
- package/src/parser/lexers/usx/index.cjs +0 -7
- package/src/parser/lexers/usx/usx_lexer.cjs +0 -321
- package/src/parser/lib/tokenize.cjs +0 -37
- package/src/parser/model/index.cjs +0 -637
- package/src/parser/parser_specs.cjs +0 -781
- package/src/pipelines/perf2x/index.cjs +0 -7
- package/src/pipelines/perf2x/perf2PkJsonPipeline.json +0 -41
- package/src/pipelines/perf2x/perf2usfmPipeline.json +0 -65
- package/src/transforms/calculateUsfmChapterPositions.cjs +0 -106
- package/src/transforms/index.cjs +0 -9
- package/src/transforms/perf2PkJson.cjs +0 -534
- package/src/transforms/perf2usfm.cjs +0 -294
- package/src/util/byteArray.cjs +0 -251
- package/src/util/canons.cjs +0 -117
- package/src/util/enums.cjs +0 -41
- package/src/util/generateId.cjs +0 -6
- package/src/util/graftDefs.cjs +0 -15
- package/src/util/index.cjs +0 -29
- package/src/util/inspectSuccinct.cjs +0 -59
- package/src/util/itemDefs.cjs +0 -33
- package/src/util/parserConstantDefs.cjs +0 -30
- package/src/util/scopeDefs.cjs +0 -173
- package/src/util/succinct.cjs +0 -159
- package/src/util/tags.cjs +0 -28
- package/src/util/tokenDefs.cjs +0 -27
- package/src/util/versification.cjs +0 -364
package/index.cjs
CHANGED
|
@@ -3,8 +3,8 @@ const {
|
|
|
3
3
|
lexingRegexes,
|
|
4
4
|
resolvers,
|
|
5
5
|
typeDefs,
|
|
6
|
+
blocksSpecUtils,
|
|
6
7
|
} = require('./src/index.cjs');
|
|
7
|
-
const blocksSpecUtils = require('./src/util/scriptlike/blocksSpec.cjs');
|
|
8
8
|
|
|
9
9
|
module.exports = {
|
|
10
10
|
Proskomma, lexingRegexes, blocksSpecUtils, resolvers, typeDefs,
|
package/package.json
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proskomma-core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.19",
|
|
4
4
|
"description": "A Scripture Runtime Engine",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"browser": "dist/bundle.js",
|
|
7
|
+
"module": "dist/module.mjs",
|
|
8
|
+
"source": "index.cjs",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"rawTest": "export PKSRC=dist &&
|
|
10
|
+
"build": "rm -fr dist && parcel build --no-source-maps",
|
|
11
|
+
"test": "export PKSRC=dist && bash -c \"tape -r @babel/register test/code/**/*.cjs | node_modules/tap-summary/bin/cmd.js\"",
|
|
12
|
+
"rawTest": "export PKSRC=dist && bash -c \"tape -r @babel/register test/code/*.cjs\"",
|
|
13
13
|
"oneTest": "bash -c \"tape -r @babel/register test/code/$TESTSCRIPT.cjs\"",
|
|
14
|
-
"
|
|
15
|
-
"coverage": "node_modules/nyc/bin/nyc.js bash -c \"tape -r @babel/register test/code/*.cjs\"",
|
|
16
|
-
"build": "rm -fr dist && webpack --mode production --config webpack.prod.js",
|
|
17
|
-
"serialize": "tape -r @babel/register test/code/serialize.cjs",
|
|
18
|
-
"rawSrcTest": "export PKSRC=src && bash -c \"tape test/code/main/*.cjs\"",
|
|
19
|
-
"testUtils": "bash -c \"tape test/code/utils/*.cjs\""
|
|
14
|
+
"prepublishOnly": "rm -fr dist && npm run build"
|
|
20
15
|
},
|
|
21
16
|
"repository": {
|
|
22
17
|
"type": "git",
|
|
@@ -37,24 +32,17 @@
|
|
|
37
32
|
},
|
|
38
33
|
"homepage": "https://github.com/Proskomma/proskomma-core#readme",
|
|
39
34
|
"dependencies": {
|
|
40
|
-
"@babel/core": "^7.19.0",
|
|
41
35
|
"@graphql-tools/schema": "^9.0.3",
|
|
42
|
-
"assert": "^2.0.0",
|
|
43
36
|
"async-mutex": "^0.4.0",
|
|
44
|
-
"
|
|
37
|
+
"base-64": "^1.0.0",
|
|
45
38
|
"base64-js": "^1.5.1",
|
|
46
39
|
"bitset": "^5.1.1",
|
|
47
|
-
"
|
|
48
|
-
"checksum": "^1.0.0",
|
|
49
|
-
"constants-browserify": "^1.0.0",
|
|
50
|
-
"crypto-browserify": "^3.12.0",
|
|
40
|
+
"buffer": "^6.0.3",
|
|
51
41
|
"deep-copy-all": "^1.3.4",
|
|
52
42
|
"deep-equal": "^2.0.5",
|
|
53
|
-
"
|
|
43
|
+
"easy-crc32": "^0.0.2",
|
|
54
44
|
"fs-extra": "^11.1.0",
|
|
55
45
|
"graphql": "^v16.6.0",
|
|
56
|
-
"node-polyfill-webpack-plugin": "^2.0.1",
|
|
57
|
-
"path-browserify": "^1.0.1",
|
|
58
46
|
"proskomma-json-tools": "^0.6.5",
|
|
59
47
|
"pure-uuid": "^1.6.2",
|
|
60
48
|
"sax": "^1.2.4",
|
|
@@ -65,24 +53,21 @@
|
|
|
65
53
|
"xregexp": "^5.1.1"
|
|
66
54
|
},
|
|
67
55
|
"devDependencies": {
|
|
68
|
-
"@babel/
|
|
69
|
-
"@babel/eslint-parser": "^7.18.9",
|
|
70
|
-
"@babel/preset-env": "^7.19.0",
|
|
56
|
+
"@babel/eslint-parser": "^7.19.1",
|
|
71
57
|
"@babel/register": "^7.18.9",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"eslint": "^8.23.0",
|
|
75
|
-
"eslint-config-prettier": "^8.5.0",
|
|
76
|
-
"eslint-plugin-import": "^2.26.0",
|
|
77
|
-
"eslint-plugin-jsdoc": "^39.3.6",
|
|
78
|
-
"eslint-plugin-prettier": "^v4.2.1",
|
|
79
|
-
"nyc": "^15.1.0",
|
|
80
|
-
"path": "^0.12.7",
|
|
81
|
-
"prettier": "^2.7.1",
|
|
58
|
+
"events": "^3.3.0",
|
|
59
|
+
"parcel": "^2.8.3",
|
|
82
60
|
"process": "^0.11.10",
|
|
61
|
+
"stream-browserify": "^3.0.0",
|
|
83
62
|
"tap-summary": "^4.0.0",
|
|
84
|
-
"tape": "^5.6.0"
|
|
85
|
-
|
|
86
|
-
|
|
63
|
+
"tape": "^5.6.0"
|
|
64
|
+
},
|
|
65
|
+
"targets": {
|
|
66
|
+
"main": {
|
|
67
|
+
"optimize": true
|
|
68
|
+
},
|
|
69
|
+
"browser": {
|
|
70
|
+
"optimize": true
|
|
71
|
+
}
|
|
87
72
|
}
|
|
88
73
|
}
|
package/esm/package.json
DELETED
package/esm/wrapper.mjs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
## Participants
|
|
4
|
-
|
|
5
|
-
- Birch
|
|
6
|
-
- Incy
|
|
7
|
-
- Mark Howe
|
|
8
|
-
- Nicolas Condomitti
|
|
9
|
-
|
|
10
|
-
## Discussions
|
|
11
|
-
|
|
12
|
-
Birch's suggestions :
|
|
13
|
-
* handle usfm 3 format from unfoldingWord
|
|
14
|
-
* accept that there **will** be multiple format : so the API must handle that
|
|
15
|
-
* uW format IN and uW format OUT
|
|
16
|
-
* let's go quickly to the **first** solution
|
|
17
|
-
* contact Chris and Bruce. They produced a UI.
|
|
18
|
-
|
|
19
|
-
Mark's suggestions :
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Bincy's suggestions :
|
|
23
|
-
* an english team are working on aligning the old testament. It would be IMMENSLY helpful to have a working tool to correct broken alignment
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
## My conclusion
|
|
27
|
-
|
|
28
|
-
Let's go to the first "simple" solution :
|
|
29
|
-
* make a card in https://gateway-translate.netlify.app/
|
|
30
|
-
* to correct the broken alignment on the go when you correct a text
|
|
31
|
-
* **it HAS TO LIKE EXACTLY LIKE TRANSLATION-CORE**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## TODO
|
|
35
|
-
|
|
36
|
-
- [ ] mini editeur : TCore-like
|
|
37
|
-
- [ ] travailler sur côté Epitelete pour communiquer les modifications à Proskomma
|
|
38
|
-
- [ ] essayer de mettre ça en "Card" pour gateway-translate
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
const utils = require('../index.cjs');
|
|
2
|
-
const { labelForScope } = utils.scopeDefs;
|
|
3
|
-
const { tokenizeString } = require('../../parser/lib/tokenize.cjs');
|
|
4
|
-
const {
|
|
5
|
-
flattenNodes,
|
|
6
|
-
numberNodes,
|
|
7
|
-
} = require('../../parser/lexers/nodes.cjs');
|
|
8
|
-
|
|
9
|
-
const tsvToInputBlock = (tsv, hasHeadings) => {
|
|
10
|
-
const ret = [];
|
|
11
|
-
const rows = tsv.split(/[\n\r]+/);
|
|
12
|
-
|
|
13
|
-
for (const [rowN, rowTSV] of rows.entries()) {
|
|
14
|
-
if (hasHeadings && rowN === 0) {
|
|
15
|
-
continue;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const row = rowTSV.split('\t');
|
|
19
|
-
|
|
20
|
-
for (const [cellN, cellString] of row.entries()) {
|
|
21
|
-
const cellRecord = {
|
|
22
|
-
os: [],
|
|
23
|
-
bg: [],
|
|
24
|
-
bs: {
|
|
25
|
-
type: 'scope',
|
|
26
|
-
subType: 'start',
|
|
27
|
-
payload: labelForScope('tTableRow', [`${rowN}`]),
|
|
28
|
-
},
|
|
29
|
-
is: [],
|
|
30
|
-
items: [],
|
|
31
|
-
};
|
|
32
|
-
const colScope = `tTableCol/${cellN}`;
|
|
33
|
-
|
|
34
|
-
cellRecord.is.push({
|
|
35
|
-
type: 'scope',
|
|
36
|
-
subType: 'start',
|
|
37
|
-
payload: colScope,
|
|
38
|
-
});
|
|
39
|
-
cellRecord.items.push({
|
|
40
|
-
type: 'scope',
|
|
41
|
-
subType: 'start',
|
|
42
|
-
payload: colScope,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
for (const [token, tokenType] of tokenizeString(cellString)) {
|
|
46
|
-
cellRecord.items.push({
|
|
47
|
-
type: 'token',
|
|
48
|
-
subType: tokenType,
|
|
49
|
-
payload: token,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
cellRecord.items.push({
|
|
53
|
-
type: 'scope',
|
|
54
|
-
subType: 'end',
|
|
55
|
-
payload: colScope,
|
|
56
|
-
});
|
|
57
|
-
ret.push(cellRecord);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return ret;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const tsvHeadingTags = tsv => {
|
|
64
|
-
const firstRow = tsv.split(/[\n\r]+/)[0];
|
|
65
|
-
return firstRow.split('\t').map((c, n) => `col${n}:${c.trim()}`);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const treeToInputBlock = treeJson => {
|
|
69
|
-
const ret = [];
|
|
70
|
-
|
|
71
|
-
for (const node of flattenNodes(numberNodes(treeJson))) {
|
|
72
|
-
const nodeRecord = {
|
|
73
|
-
os: [],
|
|
74
|
-
bg: [],
|
|
75
|
-
bs: {
|
|
76
|
-
type: 'scope',
|
|
77
|
-
subType: 'start',
|
|
78
|
-
payload: labelForScope('tTreeNode', [`${node.id}`]),
|
|
79
|
-
},
|
|
80
|
-
is: [],
|
|
81
|
-
items: [],
|
|
82
|
-
};
|
|
83
|
-
const scopePayload = labelForScope('tTreeParent', [`${node.parentId}`]);
|
|
84
|
-
|
|
85
|
-
nodeRecord.items.push({
|
|
86
|
-
type: 'scope',
|
|
87
|
-
subType: 'start',
|
|
88
|
-
payload: scopePayload,
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
nodeRecord.is.push({
|
|
92
|
-
type: 'scope',
|
|
93
|
-
subType: 'start',
|
|
94
|
-
payload: scopePayload,
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
if (node.content) {
|
|
98
|
-
for (const [name, content] of Object.entries(node.content)) {
|
|
99
|
-
const treeContentStart = nodeRecord.items.length;
|
|
100
|
-
const tokenized = tokenizeString(content);
|
|
101
|
-
const scopePayload = labelForScope('tTreeContent', [name, node.id, `${treeContentStart}`, `${tokenized.length}`]);
|
|
102
|
-
|
|
103
|
-
nodeRecord.items.push({
|
|
104
|
-
type: 'scope',
|
|
105
|
-
subType: 'start',
|
|
106
|
-
payload: scopePayload,
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
nodeRecord.is.push({
|
|
110
|
-
type: 'scope',
|
|
111
|
-
subType: 'start',
|
|
112
|
-
payload: scopePayload,
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
for (const [payload, subType] of tokenized) {
|
|
116
|
-
nodeRecord.items.push({
|
|
117
|
-
type: 'token',
|
|
118
|
-
subType,
|
|
119
|
-
payload,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
nodeRecord.items.push({
|
|
123
|
-
type: 'scope',
|
|
124
|
-
subType: 'end',
|
|
125
|
-
payload: scopePayload,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (node.children) {
|
|
131
|
-
for (const [childN, childNodeN] of node.children.entries()) {
|
|
132
|
-
const scopePayload = labelForScope('tTreeChild', [childN, childNodeN]);
|
|
133
|
-
|
|
134
|
-
nodeRecord.items.push({
|
|
135
|
-
type: 'scope',
|
|
136
|
-
subType: 'start',
|
|
137
|
-
payload: scopePayload,
|
|
138
|
-
});
|
|
139
|
-
nodeRecord.is.push({
|
|
140
|
-
type: 'scope',
|
|
141
|
-
subType: 'start',
|
|
142
|
-
payload: scopePayload,
|
|
143
|
-
});
|
|
144
|
-
nodeRecord.items.push({
|
|
145
|
-
type: 'scope',
|
|
146
|
-
subType: 'end',
|
|
147
|
-
payload: scopePayload,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
nodeRecord.items.push({
|
|
152
|
-
type: 'scope',
|
|
153
|
-
subType: 'end',
|
|
154
|
-
payload: scopePayload,
|
|
155
|
-
});
|
|
156
|
-
ret.push(nodeRecord);
|
|
157
|
-
}
|
|
158
|
-
return ret;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
const escapePayload =
|
|
162
|
-
str =>
|
|
163
|
-
str.replace(/\\/g, '\\\\')
|
|
164
|
-
.replace(/"/g, '\\"')
|
|
165
|
-
.replace(/\n/g, '\\n')
|
|
166
|
-
.replace(/\t/g, '\\t')
|
|
167
|
-
.replace(/\r/g, '\\r');
|
|
168
|
-
|
|
169
|
-
const object2Query = obs =>
|
|
170
|
-
'[' +
|
|
171
|
-
obs.map(
|
|
172
|
-
ob => `\n {\n type: "${ob.type}" \n subType: "${ob.subType}" \n payload: "${escapePayload(ob.payload)}"\n }`,
|
|
173
|
-
).join(',') +
|
|
174
|
-
']';
|
|
175
|
-
const oneObject2Query = ob => `{\n type: "${ob.type}" \n subType: "${ob.subType}" \n payload: "${escapePayload(ob.payload)}"}`;
|
|
176
|
-
const blocksSpec2Query =
|
|
177
|
-
bSpec =>
|
|
178
|
-
'[\n' +
|
|
179
|
-
bSpec.map(
|
|
180
|
-
b =>
|
|
181
|
-
` {\n bs: ${oneObject2Query(b.bs)}, \n bg: ${object2Query(b.bg)}, \n os: ${object2Query(b.os)}, \n is: ${object2Query(b.is)}, \n items: ${object2Query(b.items)}}\n`) +
|
|
182
|
-
']';
|
|
183
|
-
|
|
184
|
-
module.exports = {
|
|
185
|
-
tokenizeString,
|
|
186
|
-
tsvToInputBlock,
|
|
187
|
-
tsvHeadingTags,
|
|
188
|
-
treeToInputBlock,
|
|
189
|
-
blocksSpec2Query,
|
|
190
|
-
object2Query,
|
|
191
|
-
oneObject2Query,
|
|
192
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" ?>
|
|
2
|
-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
3
|
-
|
|
4
|
-
<xsl:output method="text"/>
|
|
5
|
-
|
|
6
|
-
<xsl:template match="/">
|
|
7
|
-
<xsl:for-each select="/*/*">
|
|
8
|
-
<xsl:value-of select="normalize-space(substring-before(@n, '|'))"/>
|
|
9
|
-
<xsl:text>	</xsl:text>
|
|
10
|
-
<xsl:value-of select="normalize-space(substring-after(@n, '|'))"/>
|
|
11
|
-
<xsl:text>	</xsl:text>
|
|
12
|
-
<xsl:value-of select="normalize-space(*[2])"/>
|
|
13
|
-
<xsl:text>	</xsl:text>
|
|
14
|
-
<xsl:value-of select="normalize-space(*[3])"/>
|
|
15
|
-
<xsl:text>
</xsl:text>
|
|
16
|
-
</xsl:for-each>
|
|
17
|
-
</xsl:template>
|
|
18
|
-
|
|
19
|
-
</xsl:stylesheet>
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
const fse = require('fs-extra');
|
|
2
|
-
const { tokenizeString } = require('./blocksSpec.cjs');
|
|
3
|
-
|
|
4
|
-
const itemTokens = str => tokenizeString(str).map(tr => ({
|
|
5
|
-
type: 'token',
|
|
6
|
-
subType: tr[1],
|
|
7
|
-
payload: tr[0],
|
|
8
|
-
}));
|
|
9
|
-
|
|
10
|
-
const rowRecord = rowArray => ({
|
|
11
|
-
'bs': {
|
|
12
|
-
'type': 'scope',
|
|
13
|
-
'subType': 'start',
|
|
14
|
-
'payload': `kvPrimary/${rowArray[0]}`,
|
|
15
|
-
},
|
|
16
|
-
'bg': [],
|
|
17
|
-
'os': [],
|
|
18
|
-
'is': [
|
|
19
|
-
{
|
|
20
|
-
'type': 'scope',
|
|
21
|
-
'subType': 'start',
|
|
22
|
-
'payload': `kvSecondary/strong/${rowArray[1]}`,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
'type': 'scope',
|
|
26
|
-
'subType': 'start',
|
|
27
|
-
'payload': 'kvField/briefDef',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
'type': 'scope',
|
|
31
|
-
'subType': 'start',
|
|
32
|
-
'payload': 'kvField/fullDef',
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
'items': [
|
|
36
|
-
{
|
|
37
|
-
'type': 'scope',
|
|
38
|
-
'subType': 'start',
|
|
39
|
-
'payload': `kvSecondary/strong/${rowArray[1]}`,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
'type': 'scope',
|
|
43
|
-
'subType': 'start',
|
|
44
|
-
'payload': 'kvField/briefDef',
|
|
45
|
-
},
|
|
46
|
-
...itemTokens(rowArray[2]),
|
|
47
|
-
{
|
|
48
|
-
'type': 'scope',
|
|
49
|
-
'subType': 'end',
|
|
50
|
-
'payload': 'kvField/briefDef',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
'type': 'scope',
|
|
54
|
-
'subType': 'start',
|
|
55
|
-
'payload': 'kvField/fullDef',
|
|
56
|
-
},
|
|
57
|
-
...itemTokens(rowArray[3]),
|
|
58
|
-
{
|
|
59
|
-
'type': 'scope',
|
|
60
|
-
'subType': 'end',
|
|
61
|
-
'payload': 'kvField/fullDef',
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
'type': 'scope',
|
|
65
|
-
'subType': 'end',
|
|
66
|
-
'payload': `kvSecondary/strong/${rowArray[1]}`,
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const lexicon_tsv = fse.readFileSync(process.argv[2])
|
|
72
|
-
.toString()
|
|
73
|
-
.split('\n')
|
|
74
|
-
.map(row => row.split('\t'))
|
|
75
|
-
.filter(row => row.length > 1);
|
|
76
|
-
|
|
77
|
-
console.log(
|
|
78
|
-
JSON.stringify(
|
|
79
|
-
lexicon_tsv.map(
|
|
80
|
-
row => rowRecord(row),
|
|
81
|
-
),
|
|
82
|
-
null,
|
|
83
|
-
2,
|
|
84
|
-
),
|
|
85
|
-
);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" ?>
|
|
2
|
-
<xsl:stylesheet
|
|
3
|
-
version="1.0"
|
|
4
|
-
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
5
|
-
xmlns:os="http://openscriptures.github.com/morphhb/namespace">
|
|
6
|
-
|
|
7
|
-
<xsl:output method="text"/>
|
|
8
|
-
|
|
9
|
-
<xsl:template match="/os:lexicon">
|
|
10
|
-
<xsl:for-each select="os:entry">
|
|
11
|
-
<xsl:value-of select="os:w/text()"/>
|
|
12
|
-
<xsl:text>	</xsl:text>
|
|
13
|
-
<xsl:value-of select="@id"/>
|
|
14
|
-
<xsl:text>	</xsl:text>
|
|
15
|
-
<xsl:value-of select="os:w/@pos"/>
|
|
16
|
-
<xsl:text>	</xsl:text>
|
|
17
|
-
<xsl:value-of select="os:meaning"/>
|
|
18
|
-
<xsl:text>	</xsl:text>
|
|
19
|
-
<xsl:for-each select="os:meaning/os:def">
|
|
20
|
-
<xsl:value-of select="concat(./text(), '; .cjs')"/>
|
|
21
|
-
</xsl:for-each>
|
|
22
|
-
<xsl:text>	</xsl:text>
|
|
23
|
-
<xsl:value-of select="os:usage/text()"/>
|
|
24
|
-
<xsl:text>
</xsl:text>
|
|
25
|
-
</xsl:for-each>
|
|
26
|
-
</xsl:template>
|
|
27
|
-
|
|
28
|
-
</xsl:stylesheet>
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
const fse = require('fs-extra');
|
|
2
|
-
const { tokenizeString } = require('./blocksSpec.cjs');
|
|
3
|
-
|
|
4
|
-
const itemTokens = str => tokenizeString(str).map(tr => ({
|
|
5
|
-
type: 'token',
|
|
6
|
-
subType: tr[1],
|
|
7
|
-
payload: tr[0],
|
|
8
|
-
}));
|
|
9
|
-
|
|
10
|
-
const rowRecord = rowArray => ({
|
|
11
|
-
'bs': {
|
|
12
|
-
'type': 'scope',
|
|
13
|
-
'subType': 'start',
|
|
14
|
-
'payload': `kvPrimary/${rowArray[0]}`,
|
|
15
|
-
},
|
|
16
|
-
'bg': [],
|
|
17
|
-
'os': [],
|
|
18
|
-
'is': [
|
|
19
|
-
{
|
|
20
|
-
'type': 'scope',
|
|
21
|
-
'subType': 'start',
|
|
22
|
-
'payload': `kvSecondary/strong/${rowArray[1]}`,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
'type': 'scope',
|
|
26
|
-
'subType': 'start',
|
|
27
|
-
'payload': 'kvField/briefDef',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
'type': 'scope',
|
|
31
|
-
'subType': 'start',
|
|
32
|
-
'payload': 'kvField/fullDef',
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
'items': [
|
|
36
|
-
{
|
|
37
|
-
'type': 'scope',
|
|
38
|
-
'subType': 'start',
|
|
39
|
-
'payload': `kvSecondary/strong/${rowArray[1]}`,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
'type': 'scope',
|
|
43
|
-
'subType': 'start',
|
|
44
|
-
'payload': 'kvField/briefDef',
|
|
45
|
-
},
|
|
46
|
-
...itemTokens(rowArray[4].length > 0 ? rowArray[4].replace(/; $/, '') : rowArray[5]),
|
|
47
|
-
{
|
|
48
|
-
'type': 'scope',
|
|
49
|
-
'subType': 'end',
|
|
50
|
-
'payload': 'kvField/briefDef',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
'type': 'scope',
|
|
54
|
-
'subType': 'start',
|
|
55
|
-
'payload': 'kvField/fullDef',
|
|
56
|
-
},
|
|
57
|
-
...itemTokens(rowArray[3]),
|
|
58
|
-
{
|
|
59
|
-
'type': 'scope',
|
|
60
|
-
'subType': 'end',
|
|
61
|
-
'payload': 'kvField/fullDef',
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
'type': 'scope',
|
|
65
|
-
'subType': 'end',
|
|
66
|
-
'payload': `kvSecondary/strong/${rowArray[1]}`,
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const lexicon_tsv = fse.readFileSync(process.argv[2])
|
|
72
|
-
.toString()
|
|
73
|
-
.split('\n')
|
|
74
|
-
.map(row => row.split('\t'))
|
|
75
|
-
.filter(row => row.length > 1);
|
|
76
|
-
|
|
77
|
-
console.log(
|
|
78
|
-
JSON.stringify(
|
|
79
|
-
lexicon_tsv.map(
|
|
80
|
-
row => rowRecord(row),
|
|
81
|
-
),
|
|
82
|
-
null,
|
|
83
|
-
2,
|
|
84
|
-
),
|
|
85
|
-
);
|