hebrew-transliteration 2.0.8 → 2.1.1

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 CHANGED
@@ -576,6 +576,7 @@ declare module 'hebrew-transliteration/schema' {
576
576
  sqnmlvy: SylOpts["sqnmlvy"];
577
577
  wawShureq: SylOpts["wawShureq"];
578
578
  article: SylOpts["article"];
579
+ allowNoNiqqud: SylOpts["allowNoNiqqud"];
579
580
  constructor(schema: Schema);
580
581
  }
581
582
  export class SBL extends Schema {
package/dist/index.esm.js CHANGED
@@ -1,13 +1,6 @@
1
1
  // src/index.ts
2
2
  import { Text as Text3 } from "havarotjs";
3
3
 
4
- // src/sequence.ts
5
- import { Text } from "havarotjs";
6
- var vowels = /[\u{05B0}-\u{05BC}\u{05C7}]/u;
7
- var sequence = (text, qametsQatan = false) => {
8
- return vowels.test(text) ? new Text(text, { qametsQatan }).text : text;
9
- };
10
-
11
4
  // src/rules.ts
12
5
  import { Cluster } from "havarotjs/dist/cluster";
13
6
 
@@ -270,11 +263,12 @@ var wordRules = (word, schema) => {
270
263
  var Schema = class {
271
264
  constructor(schema) {
272
265
  this.VOCAL_SHEVA = schema.VOCAL_SHEVA, this.HATAF_SEGOL = schema.HATAF_SEGOL, this.HATAF_PATAH = schema.HATAF_PATAH, this.HATAF_QAMATS = schema.HATAF_QAMATS, this.HIRIQ = schema.HIRIQ, this.TSERE = schema.TSERE, this.SEGOL = schema.SEGOL, this.PATAH = schema.PATAH, this.QAMATS = schema.QAMATS, this.HOLAM = schema.HOLAM, this.QUBUTS = schema.QUBUTS, this.DAGESH = schema.DAGESH, this.DAGESH_CHAZAQ = schema.DAGESH_CHAZAQ, this.MAQAF = schema.MAQAF, this.PASEQ = schema.PASEQ, this.SOF_PASUQ = schema.SOF_PASUQ, this.QAMATS_QATAN = schema.QAMATS_QATAN, this.FURTIVE_PATAH = schema.FURTIVE_PATAH, this.HIRIQ_YOD = schema.HIRIQ_YOD, this.TSERE_YOD = schema.TSERE_YOD, this.SEGOL_YOD = schema.SEGOL_YOD, this.SHUREQ = schema.SHUREQ, this.HOLAM_VAV = schema.HOLAM_VAV, this.QAMATS_HE = schema.QAMATS_HE, this.SEGOL_HE = schema.SEGOL_HE, this.TSERE_HE = schema.TSERE_HE, this.MS_SUFX = schema.MS_SUFX, this.ALEF = schema.ALEF, this.BET_DAGESH = schema.BET_DAGESH, this.BET = schema.BET, this.GIMEL = schema.GIMEL, this.GIMEL_DAGESH = schema.GIMEL_DAGESH, this.DALET = schema.DALET, this.DALET_DAGESH = schema.DALET_DAGESH, this.HE = schema.HE, this.VAV = schema.VAV, this.ZAYIN = schema.ZAYIN, this.HET = schema.HET, this.TET = schema.TET, this.YOD = schema.YOD, this.FINAL_KAF = schema.FINAL_KAF, this.KAF = schema.KAF, this.KAF_DAGESH = schema.KAF_DAGESH, this.LAMED = schema.LAMED, this.FINAL_MEM = schema.FINAL_MEM, this.MEM = schema.MEM, this.FINAL_NUN = schema.FINAL_NUN, this.NUN = schema.NUN, this.SAMEKH = schema.SAMEKH, this.AYIN = schema.AYIN, this.FINAL_PE = schema.FINAL_PE, this.PE = schema.PE, this.PE_DAGESH = schema.PE_DAGESH, this.FINAL_TSADI = schema.FINAL_TSADI, this.TSADI = schema.TSADI, this.QOF = schema.QOF, this.RESH = schema.RESH, this.SHIN = schema.SHIN, this.SIN = schema.SIN, this.TAV = schema.TAV, this.TAV_DAGESH = schema.TAV_DAGESH, this.DIVINE_NAME = schema.DIVINE_NAME, this.SYLLABLE_SEPARATOR = schema.SYLLABLE_SEPARATOR, this.ADDITIONAL_FEATURES = schema.ADDITIONAL_FEATURES, this.STRESS_MARKER = schema.STRESS_MARKER, this.longVowels = schema.longVowels, this.qametsQatan = schema.qametsQatan, this.sqnmlvy = schema.sqnmlvy, this.wawShureq = schema.wawShureq, this.article = schema.article;
266
+ this.allowNoNiqqud = schema.allowNoNiqqud;
273
267
  }
274
268
  };
275
269
  var SBL = class extends Schema {
276
270
  constructor(schema) {
277
- var _a, _b, _c, _d, _e, _f;
271
+ var _a, _b, _c, _d, _e, _f, _g;
278
272
  super({
279
273
  VOCAL_SHEVA: schema.VOCAL_SHEVA || "\u01DD",
280
274
  HATAF_SEGOL: schema.HATAF_SEGOL || "\u0115",
@@ -345,13 +339,14 @@ var SBL = class extends Schema {
345
339
  qametsQatan: (_c = schema.qametsQatan) != null ? _c : true,
346
340
  sqnmlvy: (_d = schema.sqnmlvy) != null ? _d : true,
347
341
  wawShureq: (_e = schema.wawShureq) != null ? _e : true,
348
- article: (_f = schema.article) != null ? _f : true
342
+ article: (_f = schema.article) != null ? _f : true,
343
+ allowNoNiqqud: (_g = schema.allowNoNiqqud) != null ? _g : true
349
344
  });
350
345
  }
351
346
  };
352
347
 
353
348
  // src/transliterate.ts
354
- import { Text as Text2 } from "havarotjs";
349
+ import { Text } from "havarotjs";
355
350
  import { Word } from "havarotjs/dist/word";
356
351
  var getSylOpts = (schema) => {
357
352
  const options = {};
@@ -365,17 +360,13 @@ var getSylOpts = (schema) => {
365
360
  options.wawShureq = schema.wawShureq;
366
361
  if ("article" in schema)
367
362
  options.article = schema.article;
363
+ if ("allowNoNiqqud" in schema)
364
+ options.allowNoNiqqud = schema.allowNoNiqqud;
368
365
  return options;
369
366
  };
370
367
  var transliterate = (text, schema) => {
371
368
  const transSchema = schema instanceof Schema ? schema : new SBL(schema != null ? schema : {});
372
- const isText = text instanceof Text2;
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
- }
377
- const sylOptions = getSylOpts(transSchema != null ? transSchema : {});
378
- const newText = isText ? text : new Text2(text, sylOptions);
369
+ const newText = text instanceof Text ? text : new Text(text, getSylOpts(transSchema != null ? transSchema : {}));
379
370
  return newText.words.map((word) => {
380
371
  var _a, _b;
381
372
  let transliteration = wordRules(word, transSchema);
@@ -386,6 +377,13 @@ var transliterate = (text, schema) => {
386
377
  }).join("");
387
378
  };
388
379
 
380
+ // src/sequence.ts
381
+ import { Text as Text2 } from "havarotjs";
382
+ var vowels = /[\u{05B0}-\u{05BC}\u{05C7}]/u;
383
+ var sequence = (text, qametsQatan = false) => {
384
+ return vowels.test(text) ? new Text2(text, { qametsQatan }).text : text;
385
+ };
386
+
389
387
  // src/remove.ts
390
388
  var cantillation = /[\u{0591}-\u{05AF}\u{05BF}\u{05C0}\u{05C3}-\u{05C6}\u{05F3}\u{05F4}]/gu;
391
389
  var vowels2 = /[\u{05B0}-\u{05BD}\u{05BF}\u{05C7}]/gu;
package/dist/index.js CHANGED
@@ -29,13 +29,6 @@ __export(src_exports, {
29
29
  module.exports = __toCommonJS(src_exports);
30
30
  var import_havarotjs3 = require("havarotjs");
31
31
 
32
- // src/sequence.ts
33
- var import_havarotjs = require("havarotjs");
34
- var vowels = /[\u{05B0}-\u{05BC}\u{05C7}]/u;
35
- var sequence = (text, qametsQatan = false) => {
36
- return vowels.test(text) ? new import_havarotjs.Text(text, { qametsQatan }).text : text;
37
- };
38
-
39
32
  // src/rules.ts
40
33
  var import_cluster = require("havarotjs/dist/cluster");
41
34
 
@@ -298,11 +291,12 @@ var wordRules = (word, schema) => {
298
291
  var Schema = class {
299
292
  constructor(schema) {
300
293
  this.VOCAL_SHEVA = schema.VOCAL_SHEVA, this.HATAF_SEGOL = schema.HATAF_SEGOL, this.HATAF_PATAH = schema.HATAF_PATAH, this.HATAF_QAMATS = schema.HATAF_QAMATS, this.HIRIQ = schema.HIRIQ, this.TSERE = schema.TSERE, this.SEGOL = schema.SEGOL, this.PATAH = schema.PATAH, this.QAMATS = schema.QAMATS, this.HOLAM = schema.HOLAM, this.QUBUTS = schema.QUBUTS, this.DAGESH = schema.DAGESH, this.DAGESH_CHAZAQ = schema.DAGESH_CHAZAQ, this.MAQAF = schema.MAQAF, this.PASEQ = schema.PASEQ, this.SOF_PASUQ = schema.SOF_PASUQ, this.QAMATS_QATAN = schema.QAMATS_QATAN, this.FURTIVE_PATAH = schema.FURTIVE_PATAH, this.HIRIQ_YOD = schema.HIRIQ_YOD, this.TSERE_YOD = schema.TSERE_YOD, this.SEGOL_YOD = schema.SEGOL_YOD, this.SHUREQ = schema.SHUREQ, this.HOLAM_VAV = schema.HOLAM_VAV, this.QAMATS_HE = schema.QAMATS_HE, this.SEGOL_HE = schema.SEGOL_HE, this.TSERE_HE = schema.TSERE_HE, this.MS_SUFX = schema.MS_SUFX, this.ALEF = schema.ALEF, this.BET_DAGESH = schema.BET_DAGESH, this.BET = schema.BET, this.GIMEL = schema.GIMEL, this.GIMEL_DAGESH = schema.GIMEL_DAGESH, this.DALET = schema.DALET, this.DALET_DAGESH = schema.DALET_DAGESH, this.HE = schema.HE, this.VAV = schema.VAV, this.ZAYIN = schema.ZAYIN, this.HET = schema.HET, this.TET = schema.TET, this.YOD = schema.YOD, this.FINAL_KAF = schema.FINAL_KAF, this.KAF = schema.KAF, this.KAF_DAGESH = schema.KAF_DAGESH, this.LAMED = schema.LAMED, this.FINAL_MEM = schema.FINAL_MEM, this.MEM = schema.MEM, this.FINAL_NUN = schema.FINAL_NUN, this.NUN = schema.NUN, this.SAMEKH = schema.SAMEKH, this.AYIN = schema.AYIN, this.FINAL_PE = schema.FINAL_PE, this.PE = schema.PE, this.PE_DAGESH = schema.PE_DAGESH, this.FINAL_TSADI = schema.FINAL_TSADI, this.TSADI = schema.TSADI, this.QOF = schema.QOF, this.RESH = schema.RESH, this.SHIN = schema.SHIN, this.SIN = schema.SIN, this.TAV = schema.TAV, this.TAV_DAGESH = schema.TAV_DAGESH, this.DIVINE_NAME = schema.DIVINE_NAME, this.SYLLABLE_SEPARATOR = schema.SYLLABLE_SEPARATOR, this.ADDITIONAL_FEATURES = schema.ADDITIONAL_FEATURES, this.STRESS_MARKER = schema.STRESS_MARKER, this.longVowels = schema.longVowels, this.qametsQatan = schema.qametsQatan, this.sqnmlvy = schema.sqnmlvy, this.wawShureq = schema.wawShureq, this.article = schema.article;
294
+ this.allowNoNiqqud = schema.allowNoNiqqud;
301
295
  }
302
296
  };
303
297
  var SBL = class extends Schema {
304
298
  constructor(schema) {
305
- var _a, _b, _c, _d, _e, _f;
299
+ var _a, _b, _c, _d, _e, _f, _g;
306
300
  super({
307
301
  VOCAL_SHEVA: schema.VOCAL_SHEVA || "\u01DD",
308
302
  HATAF_SEGOL: schema.HATAF_SEGOL || "\u0115",
@@ -373,13 +367,14 @@ var SBL = class extends Schema {
373
367
  qametsQatan: (_c = schema.qametsQatan) != null ? _c : true,
374
368
  sqnmlvy: (_d = schema.sqnmlvy) != null ? _d : true,
375
369
  wawShureq: (_e = schema.wawShureq) != null ? _e : true,
376
- article: (_f = schema.article) != null ? _f : true
370
+ article: (_f = schema.article) != null ? _f : true,
371
+ allowNoNiqqud: (_g = schema.allowNoNiqqud) != null ? _g : true
377
372
  });
378
373
  }
379
374
  };
380
375
 
381
376
  // src/transliterate.ts
382
- var import_havarotjs2 = require("havarotjs");
377
+ var import_havarotjs = require("havarotjs");
383
378
  var import_word = require("havarotjs/dist/word");
384
379
  var getSylOpts = (schema) => {
385
380
  const options = {};
@@ -393,17 +388,13 @@ var getSylOpts = (schema) => {
393
388
  options.wawShureq = schema.wawShureq;
394
389
  if ("article" in schema)
395
390
  options.article = schema.article;
391
+ if ("allowNoNiqqud" in schema)
392
+ options.allowNoNiqqud = schema.allowNoNiqqud;
396
393
  return options;
397
394
  };
398
395
  var transliterate = (text, schema) => {
399
396
  const transSchema = schema instanceof Schema ? schema : new SBL(schema != null ? schema : {});
400
- const isText = text instanceof import_havarotjs2.Text;
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
- }
405
- const sylOptions = getSylOpts(transSchema != null ? transSchema : {});
406
- const newText = isText ? text : new import_havarotjs2.Text(text, sylOptions);
397
+ const newText = text instanceof import_havarotjs.Text ? text : new import_havarotjs.Text(text, getSylOpts(transSchema != null ? transSchema : {}));
407
398
  return newText.words.map((word) => {
408
399
  var _a, _b;
409
400
  let transliteration = wordRules(word, transSchema);
@@ -414,6 +405,13 @@ var transliterate = (text, schema) => {
414
405
  }).join("");
415
406
  };
416
407
 
408
+ // src/sequence.ts
409
+ var import_havarotjs2 = require("havarotjs");
410
+ var vowels = /[\u{05B0}-\u{05BC}\u{05C7}]/u;
411
+ var sequence = (text, qametsQatan = false) => {
412
+ return vowels.test(text) ? new import_havarotjs2.Text(text, { qametsQatan }).text : text;
413
+ };
414
+
417
415
  // src/remove.ts
418
416
  var cantillation = /[\u{0591}-\u{05AF}\u{05BF}\u{05C0}\u{05C3}-\u{05C6}\u{05F3}\u{05F4}]/gu;
419
417
  var vowels2 = /[\u{05B0}-\u{05BD}\u{05BF}\u{05C7}]/gu;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hebrew-transliteration",
3
- "version": "2.0.8",
3
+ "version": "2.1.1",
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": "^28.1.4",
41
- "@typescript-eslint/eslint-plugin": "^5.35.1",
42
- "esbuild": "^0.15.5",
43
- "eslint": "^8.23.0",
40
+ "@types/jest": "^29.0.3",
41
+ "@typescript-eslint/eslint-plugin": "^5.38.0",
42
+ "esbuild": "^0.15.9",
43
+ "eslint": "^8.24.0",
44
44
  "eslint-config-prettier": "^8.5.0",
45
- "eslint-plugin-jest": "^26.8.7",
45
+ "eslint-plugin-jest": "^27.0.4",
46
46
  "eslint-plugin-jsdoc": "^39.3.6",
47
47
  "eslint-plugin-prefer-arrow": "^1.2.3",
48
- "jest": "^28.1.2",
49
- "npm-check-updates": "^16.0.6",
48
+ "jest": "^29.0.3",
49
+ "npm-check-updates": "^16.3.2",
50
50
  "npm-dts": "^1.3.12",
51
51
  "prettier": "^2.7.1",
52
- "ts-jest": "^28.0.5",
53
- "typescript": "^4.8.2"
52
+ "ts-jest": "^29.0.2",
53
+ "typescript": "^4.8.3"
54
54
  },
55
55
  "dependencies": {
56
- "havarotjs": "^0.8.1"
56
+ "havarotjs": "^0.9.1"
57
57
  }
58
58
  }