hebrew-transliteration 2.0.4 → 2.0.7
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/index.d.ts +1 -1
- package/dist/index.esm.js +7 -3
- package/dist/index.js +8 -3
- package/package.json +14 -14
package/dist/index.d.ts
CHANGED
|
@@ -649,7 +649,7 @@ declare module 'hebrew-transliteration/transliterate' {
|
|
|
649
649
|
* ```
|
|
650
650
|
*
|
|
651
651
|
*/
|
|
652
|
-
export const transliterate: (text: string | Text, schema?:
|
|
652
|
+
export const transliterate: (text: string | Text, schema?: Partial<Schema> | Schema) => string;
|
|
653
653
|
|
|
654
654
|
}
|
|
655
655
|
declare module 'hebrew-transliteration' {
|
package/dist/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Text as Text3 } from "havarotjs";
|
|
|
3
3
|
|
|
4
4
|
// src/sequence.ts
|
|
5
5
|
import { Text } from "havarotjs";
|
|
6
|
-
var vowels = /[\u{05B0}-\u{
|
|
6
|
+
var vowels = /[\u{05B0}-\u{05BC}\u{05C7}]/u;
|
|
7
7
|
var sequence = (text, qametsQatan = false) => {
|
|
8
8
|
return vowels.test(text) ? new Text(text, { qametsQatan }).text : text;
|
|
9
9
|
};
|
|
@@ -250,6 +250,8 @@ var wordRules = (word, schema) => {
|
|
|
250
250
|
return schema.DIVINE_NAME;
|
|
251
251
|
if (word.hasDivineName)
|
|
252
252
|
return `${sylRules(word.syllables[0], schema)}-${schema.DIVINE_NAME}`;
|
|
253
|
+
if (word.isNotHebrew)
|
|
254
|
+
return word.text;
|
|
253
255
|
if ((_a = schema.ADDITIONAL_FEATURES) == null ? void 0 : _a.length) {
|
|
254
256
|
const wordSeqs = schema.ADDITIONAL_FEATURES.filter((s) => s.FEATURE === "word");
|
|
255
257
|
for (const seq of wordSeqs) {
|
|
@@ -368,8 +370,10 @@ var getSylOpts = (schema) => {
|
|
|
368
370
|
var transliterate = (text, schema) => {
|
|
369
371
|
const transSchema = schema instanceof Schema ? schema : new SBL(schema != null ? schema : {});
|
|
370
372
|
const isText = text instanceof Text2;
|
|
371
|
-
if (!isText && !vowels.test(text))
|
|
372
|
-
|
|
373
|
+
if (!isText && !vowels.test(text)) {
|
|
374
|
+
const sin = new RegExp(transSchema.SHIN + "\u05C2", "gu");
|
|
375
|
+
return mapChars(text, transSchema).replace(sin, transSchema.SIN).replace(/[\u{0590}-\u{05AF}\u{05BD}-\u{05C6}]/gu, "");
|
|
376
|
+
}
|
|
373
377
|
const sylOptions = getSylOpts(transSchema != null ? transSchema : {});
|
|
374
378
|
const newText = isText ? text : new Text2(text, sylOptions);
|
|
375
379
|
return newText.words.map((word) => {
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -30,7 +31,7 @@ var import_havarotjs3 = require("havarotjs");
|
|
|
30
31
|
|
|
31
32
|
// src/sequence.ts
|
|
32
33
|
var import_havarotjs = require("havarotjs");
|
|
33
|
-
var vowels = /[\u{05B0}-\u{
|
|
34
|
+
var vowels = /[\u{05B0}-\u{05BC}\u{05C7}]/u;
|
|
34
35
|
var sequence = (text, qametsQatan = false) => {
|
|
35
36
|
return vowels.test(text) ? new import_havarotjs.Text(text, { qametsQatan }).text : text;
|
|
36
37
|
};
|
|
@@ -277,6 +278,8 @@ var wordRules = (word, schema) => {
|
|
|
277
278
|
return schema.DIVINE_NAME;
|
|
278
279
|
if (word.hasDivineName)
|
|
279
280
|
return `${sylRules(word.syllables[0], schema)}-${schema.DIVINE_NAME}`;
|
|
281
|
+
if (word.isNotHebrew)
|
|
282
|
+
return word.text;
|
|
280
283
|
if ((_a = schema.ADDITIONAL_FEATURES) == null ? void 0 : _a.length) {
|
|
281
284
|
const wordSeqs = schema.ADDITIONAL_FEATURES.filter((s) => s.FEATURE === "word");
|
|
282
285
|
for (const seq of wordSeqs) {
|
|
@@ -395,8 +398,10 @@ var getSylOpts = (schema) => {
|
|
|
395
398
|
var transliterate = (text, schema) => {
|
|
396
399
|
const transSchema = schema instanceof Schema ? schema : new SBL(schema != null ? schema : {});
|
|
397
400
|
const isText = text instanceof import_havarotjs2.Text;
|
|
398
|
-
if (!isText && !vowels.test(text))
|
|
399
|
-
|
|
401
|
+
if (!isText && !vowels.test(text)) {
|
|
402
|
+
const sin = new RegExp(transSchema.SHIN + "\u05C2", "gu");
|
|
403
|
+
return mapChars(text, transSchema).replace(sin, transSchema.SIN).replace(/[\u{0590}-\u{05AF}\u{05BD}-\u{05C6}]/gu, "");
|
|
404
|
+
}
|
|
400
405
|
const sylOptions = getSylOpts(transSchema != null ? transSchema : {});
|
|
401
406
|
const newText = isText ? text : new import_havarotjs2.Text(text, sylOptions);
|
|
402
407
|
return newText.words.map((word) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hebrew-transliteration",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "a package for transliterating Hebrew",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -37,22 +37,22 @@
|
|
|
37
37
|
"author": "Charles Loder",
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/jest": "^
|
|
41
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
42
|
-
"esbuild": "^0.14.
|
|
43
|
-
"eslint": "^8.
|
|
40
|
+
"@types/jest": "^28.1.4",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^5.30.4",
|
|
42
|
+
"esbuild": "^0.14.48",
|
|
43
|
+
"eslint": "^8.19.0",
|
|
44
44
|
"eslint-config-prettier": "^8.5.0",
|
|
45
|
-
"eslint-plugin-jest": "^26.
|
|
46
|
-
"eslint-plugin-jsdoc": "^39.
|
|
45
|
+
"eslint-plugin-jest": "^26.5.3",
|
|
46
|
+
"eslint-plugin-jsdoc": "^39.3.3",
|
|
47
47
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
48
|
-
"jest": "^
|
|
49
|
-
"npm-check-updates": "^
|
|
50
|
-
"npm-dts": "^1.3.
|
|
51
|
-
"prettier": "^2.
|
|
52
|
-
"ts-jest": "^
|
|
53
|
-
"typescript": "^4.
|
|
48
|
+
"jest": "^28.1.2",
|
|
49
|
+
"npm-check-updates": "^15.0.2",
|
|
50
|
+
"npm-dts": "^1.3.12",
|
|
51
|
+
"prettier": "^2.7.1",
|
|
52
|
+
"ts-jest": "^28.0.5",
|
|
53
|
+
"typescript": "^4.7.4"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"havarotjs": "^0.
|
|
56
|
+
"havarotjs": "^0.8.0"
|
|
57
57
|
}
|
|
58
58
|
}
|