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.
Files changed (125) hide show
  1. package/dist/bundle.js +1 -0
  2. package/dist/index.cjs +1 -0
  3. package/dist/module.mjs +15888 -0
  4. package/index.cjs +1 -1
  5. package/package.json +25 -40
  6. package/esm/package.json +0 -3
  7. package/esm/wrapper.mjs +0 -7
  8. package/informations/meeting_01_march_2023.md +0 -38
  9. package/scriptlike/blocksSpec.cjs +0 -192
  10. package/scriptlike/dodson_lexicon.xsl +0 -19
  11. package/scriptlike/dodson_lexicon_to_entries.cjs +0 -85
  12. package/scriptlike/open_scriptures_hebrew_lexicon.xsl +0 -28
  13. package/scriptlike/open_scriptures_hebrew_lexicon_to_entries.cjs +0 -85
  14. package/src/graph/index.cjs +0 -201
  15. package/src/graph/lib/do_cv.cjs +0 -249
  16. package/src/graph/lib/dump.cjs +0 -40
  17. package/src/graph/lib/remake_blocks.cjs +0 -57
  18. package/src/graph/lib/sequence_chars.cjs +0 -84
  19. package/src/graph/lib/sort.cjs +0 -39
  20. package/src/graph/lib/tribos.cjs +0 -97
  21. package/src/graph/lib/tribos_expression.cjs +0 -556
  22. package/src/graph/lib/tribos_ohm_UNUSED.cjs +0 -37
  23. package/src/graph/lib/tribos_step.cjs +0 -434
  24. package/src/graph/mutations/add.cjs +0 -91
  25. package/src/graph/mutations/delete.cjs +0 -61
  26. package/src/graph/mutations/index.cjs +0 -54
  27. package/src/graph/mutations/rehash.cjs +0 -17
  28. package/src/graph/mutations/tags.cjs +0 -120
  29. package/src/graph/mutations/update.cjs +0 -210
  30. package/src/graph/mutations/versification.cjs +0 -96
  31. package/src/graph/queries/block.cjs +0 -228
  32. package/src/graph/queries/cIndex.cjs +0 -87
  33. package/src/graph/queries/cell.cjs +0 -42
  34. package/src/graph/queries/cv.cjs +0 -19
  35. package/src/graph/queries/cvBook.cjs +0 -16
  36. package/src/graph/queries/cvChapter.cjs +0 -16
  37. package/src/graph/queries/cvIndex.cjs +0 -47
  38. package/src/graph/queries/cvNavigation.cjs +0 -116
  39. package/src/graph/queries/cvVerseElement.cjs +0 -84
  40. package/src/graph/queries/cvVerses.cjs +0 -14
  41. package/src/graph/queries/doc_set.cjs +0 -220
  42. package/src/graph/queries/document.cjs +0 -555
  43. package/src/graph/queries/idParts.cjs +0 -30
  44. package/src/graph/queries/index.cjs +0 -151
  45. package/src/graph/queries/inputBlockSpec.cjs +0 -17
  46. package/src/graph/queries/inputItemObject.cjs +0 -12
  47. package/src/graph/queries/input_att_spec.cjs +0 -14
  48. package/src/graph/queries/input_key_matches.cjs +0 -11
  49. package/src/graph/queries/input_key_value.cjs +0 -11
  50. package/src/graph/queries/input_key_values.cjs +0 -11
  51. package/src/graph/queries/input_selector_spec.cjs +0 -19
  52. package/src/graph/queries/item.cjs +0 -71
  53. package/src/graph/queries/itemGroup.cjs +0 -75
  54. package/src/graph/queries/key_value.cjs +0 -18
  55. package/src/graph/queries/kv_entry.cjs +0 -21
  56. package/src/graph/queries/kv_sequence.cjs +0 -151
  57. package/src/graph/queries/node.cjs +0 -44
  58. package/src/graph/queries/orig.cjs +0 -11
  59. package/src/graph/queries/regex_index.cjs +0 -18
  60. package/src/graph/queries/row_equals_spec.cjs +0 -11
  61. package/src/graph/queries/row_match_spec.cjs +0 -11
  62. package/src/graph/queries/selector_spec.cjs +0 -29
  63. package/src/graph/queries/sequence.cjs +0 -314
  64. package/src/graph/queries/table_sequence.cjs +0 -192
  65. package/src/graph/queries/tree_sequence.cjs +0 -58
  66. package/src/graph/queries/verseNumber.cjs +0 -44
  67. package/src/graph/queries/verseRange.cjs +0 -11
  68. package/src/graph/queries/versification.cjs +0 -25
  69. package/src/index.cjs +0 -583
  70. package/src/model/doc_set.cjs +0 -389
  71. package/src/model/doc_set_helpers/block.cjs +0 -232
  72. package/src/model/doc_set_helpers/enum.cjs +0 -87
  73. package/src/model/doc_set_helpers/item.cjs +0 -198
  74. package/src/model/doc_set_helpers/rehash.cjs +0 -53
  75. package/src/model/doc_set_helpers/selectors.cjs +0 -58
  76. package/src/model/doc_set_helpers/serialize.cjs +0 -22
  77. package/src/model/doc_set_helpers/unsuccinctify.cjs +0 -288
  78. package/src/model/doc_set_helpers/update.cjs +0 -290
  79. package/src/model/document.cjs +0 -369
  80. package/src/model/document_helpers/blocks.cjs +0 -135
  81. package/src/model/document_helpers/chapter_verse.cjs +0 -291
  82. package/src/model/document_helpers/pre_enums.cjs +0 -67
  83. package/src/model/document_helpers/sequences.cjs +0 -205
  84. package/src/model/document_helpers/serialize_succinct.cjs +0 -55
  85. package/src/model/document_helpers/succinct_filter.cjs +0 -102
  86. package/src/model/versifications/eng_vrs.cjs +0 -455
  87. package/src/model/versifications/index.cjs +0 -38
  88. package/src/model/versifications/lxx_vrs.cjs +0 -950
  89. package/src/model/versifications/org_vrs.cjs +0 -155
  90. package/src/model/versifications/rsc_vrs.cjs +0 -342
  91. package/src/model/versifications/rso_vrs.cjs +0 -541
  92. package/src/model/versifications/vul_vrs.cjs +0 -835
  93. package/src/parser/index.cjs +0 -504
  94. package/src/parser/lexers/index.cjs +0 -11
  95. package/src/parser/lexers/lexingRegexes.cjs +0 -45
  96. package/src/parser/lexers/nodes.cjs +0 -123
  97. package/src/parser/lexers/object_for_fragment.cjs +0 -123
  98. package/src/parser/lexers/tsv.cjs +0 -45
  99. package/src/parser/lexers/usfm.cjs +0 -17
  100. package/src/parser/lexers/usx/index.cjs +0 -7
  101. package/src/parser/lexers/usx/usx_lexer.cjs +0 -321
  102. package/src/parser/lib/tokenize.cjs +0 -37
  103. package/src/parser/model/index.cjs +0 -637
  104. package/src/parser/parser_specs.cjs +0 -781
  105. package/src/pipelines/perf2x/index.cjs +0 -7
  106. package/src/pipelines/perf2x/perf2PkJsonPipeline.json +0 -41
  107. package/src/pipelines/perf2x/perf2usfmPipeline.json +0 -65
  108. package/src/transforms/calculateUsfmChapterPositions.cjs +0 -106
  109. package/src/transforms/index.cjs +0 -9
  110. package/src/transforms/perf2PkJson.cjs +0 -534
  111. package/src/transforms/perf2usfm.cjs +0 -294
  112. package/src/util/byteArray.cjs +0 -251
  113. package/src/util/canons.cjs +0 -117
  114. package/src/util/enums.cjs +0 -41
  115. package/src/util/generateId.cjs +0 -6
  116. package/src/util/graftDefs.cjs +0 -15
  117. package/src/util/index.cjs +0 -29
  118. package/src/util/inspectSuccinct.cjs +0 -59
  119. package/src/util/itemDefs.cjs +0 -33
  120. package/src/util/parserConstantDefs.cjs +0 -30
  121. package/src/util/scopeDefs.cjs +0 -173
  122. package/src/util/succinct.cjs +0 -159
  123. package/src/util/tags.cjs +0 -28
  124. package/src/util/tokenDefs.cjs +0 -27
  125. 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.17",
3
+ "version": "0.9.19",
4
4
  "description": "A Scripture Runtime Engine",
5
- "exports": {
6
- ".": "./index.cjs",
7
- "./esm": "./esm/wrapper.mjs"
8
- },
5
+ "main": "dist/index.cjs",
6
+ "browser": "dist/bundle.js",
7
+ "module": "dist/module.mjs",
8
+ "source": "index.cjs",
9
9
  "scripts": {
10
- "test": "export PKSRC=dist && npm run build && bash -c \"tape -r @babel/register test/code/*.cjs | node_modules/tap-summary/bin/cmd.js\"",
11
- "srcTest": "bash -c \"tape test/code/main/*.cjs test/code/utils/*.cjs | node_modules/tap-summary/bin/cmd.js\"",
12
- "rawTest": "export PKSRC=dist && npm run build && bash -c \"tape -r @babel/register test/code/*.cjs\"",
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
- "oneSrcTest": "export PKSRC=src && bash -c \"tape -r @babel/register test/code/$TESTSCRIPT.cjs\"",
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
- "babel-eslint": "^10.1.0",
37
+ "base-64": "^1.0.0",
45
38
  "base64-js": "^1.5.1",
46
39
  "bitset": "^5.1.1",
47
- "btoa": "^1.2.1",
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
- "exceljs": "^4.3.0",
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/cli": "^7.18.10",
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
- "babel-loader": "^8.2.5",
73
- "buffer": "^6.0.3",
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
- "webpack": "5.75.0",
86
- "webpack-cli": "4.10.0"
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
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
package/esm/wrapper.mjs DELETED
@@ -1,7 +0,0 @@
1
- import {
2
- Proskomma, lexingRegexes, blocksSpecUtils, resolvers, typeDefs,
3
- } from '../index.cjs';
4
-
5
- export {
6
- Proskomma, lexingRegexes, blocksSpecUtils, resolvers, typeDefs,
7
- };
@@ -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>&#x09;</xsl:text>
10
- <xsl:value-of select="normalize-space(substring-after(@n, '|'))"/>
11
- <xsl:text>&#x09;</xsl:text>
12
- <xsl:value-of select="normalize-space(*[2])"/>
13
- <xsl:text>&#x09;</xsl:text>
14
- <xsl:value-of select="normalize-space(*[3])"/>
15
- <xsl:text>&#x0A;</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>&#x09;</xsl:text>
13
- <xsl:value-of select="@id"/>
14
- <xsl:text>&#x09;</xsl:text>
15
- <xsl:value-of select="os:w/@pos"/>
16
- <xsl:text>&#x09;</xsl:text>
17
- <xsl:value-of select="os:meaning"/>
18
- <xsl:text>&#x09;</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>&#x09;</xsl:text>
23
- <xsl:value-of select="os:usage/text()"/>
24
- <xsl:text>&#x0A;</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
- );