kaabalah 1.0.4 → 1.0.5
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/gematria/index.d.mts +5 -2
- package/dist/gematria/index.d.ts +5 -2
- package/dist/gematria/index.js +62 -56
- package/dist/gematria/index.js.map +1 -1
- package/dist/gematria/index.mjs +62 -56
- package/dist/gematria/index.mjs.map +1 -1
- package/dist/index.js +62 -56
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -56
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { x as TreeOfLife, b as NodeData } from '../registry-CRL4UJrw.mjs';
|
|
1
|
+
import { x as TreeOfLife, N as NodeId, b as NodeData } from '../registry-CRL4UJrw.mjs';
|
|
2
2
|
|
|
3
3
|
declare const calculateGematria: (word: string, options?: {
|
|
4
4
|
calculateMissingGematriaNumbers?: boolean;
|
|
@@ -22,7 +22,10 @@ declare const calculateGematria: (word: string, options?: {
|
|
|
22
22
|
includedLetters: Map<string, {
|
|
23
23
|
letter: string;
|
|
24
24
|
value: number;
|
|
25
|
-
hebrewLetter:
|
|
25
|
+
hebrewLetter: {
|
|
26
|
+
id: NodeId;
|
|
27
|
+
data: NodeData<"hebrewLetter">;
|
|
28
|
+
};
|
|
26
29
|
isVowel: boolean;
|
|
27
30
|
}>;
|
|
28
31
|
missingGematriaNumbers: {
|
package/dist/gematria/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { x as TreeOfLife, b as NodeData } from '../registry-CRL4UJrw.js';
|
|
1
|
+
import { x as TreeOfLife, N as NodeId, b as NodeData } from '../registry-CRL4UJrw.js';
|
|
2
2
|
|
|
3
3
|
declare const calculateGematria: (word: string, options?: {
|
|
4
4
|
calculateMissingGematriaNumbers?: boolean;
|
|
@@ -22,7 +22,10 @@ declare const calculateGematria: (word: string, options?: {
|
|
|
22
22
|
includedLetters: Map<string, {
|
|
23
23
|
letter: string;
|
|
24
24
|
value: number;
|
|
25
|
-
hebrewLetter:
|
|
25
|
+
hebrewLetter: {
|
|
26
|
+
id: NodeId;
|
|
27
|
+
data: NodeData<"hebrewLetter">;
|
|
28
|
+
};
|
|
26
29
|
isVowel: boolean;
|
|
27
30
|
}>;
|
|
28
31
|
missingGematriaNumbers: {
|
package/dist/gematria/index.js
CHANGED
|
@@ -2378,49 +2378,76 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
2378
2378
|
tree = createTree({ system: SYSTEM2, parts: [] });
|
|
2379
2379
|
}
|
|
2380
2380
|
const includedLetters = /* @__PURE__ */ new Map();
|
|
2381
|
-
const
|
|
2381
|
+
const words = word.toUpperCase().trim().split(" ");
|
|
2382
2382
|
let vowelsSum = 0;
|
|
2383
2383
|
let consonantsSum = 0;
|
|
2384
2384
|
const presentGematriaNumbers = /* @__PURE__ */ new Set();
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2385
|
+
const letterPercentages = {
|
|
2386
|
+
percentageOfVowels: 0,
|
|
2387
|
+
percentageOfConsonants: 0,
|
|
2388
|
+
letters: {}
|
|
2389
|
+
};
|
|
2390
|
+
for (const word2 of words) {
|
|
2391
|
+
const letters = word2.split("");
|
|
2392
|
+
for (let i = 0; i < letters.length; i++) {
|
|
2393
|
+
const letter = letters[i].toLocaleUpperCase();
|
|
2394
|
+
const nextLetter = letters[i + 1]?.toLocaleLowerCase() || "";
|
|
2395
|
+
if (["P", "T", "K", "S", "C"].includes(letter) && nextLetter) {
|
|
2396
|
+
const combinedLetter = letter + nextLetter;
|
|
2397
|
+
const isEnding2 = i > 0 && i === letters.length - 2;
|
|
2398
|
+
const latinLetterId2 = `letter:${combinedLetter}`;
|
|
2399
|
+
const [mapping2] = tree.walk(latinLetterId2, 2, "hebrewLetter");
|
|
2400
|
+
if (mapping2?.data) {
|
|
2401
|
+
let value = mapping2.data.gematriaValue;
|
|
2402
|
+
if (isEnding2 && mapping2.data.gematriaValueWhenEnding !== void 0) {
|
|
2403
|
+
value = mapping2.data.gematriaValueWhenEnding;
|
|
2404
|
+
}
|
|
2405
|
+
presentGematriaNumbers.add(value);
|
|
2406
|
+
includedLetters.set(latinLetterId2, { letter: combinedLetter, value, hebrewLetter: { id: mapping2.id, data: mapping2.data }, isVowel: isVowel(letter) });
|
|
2407
|
+
consonantsSum += value;
|
|
2408
|
+
i++;
|
|
2409
|
+
continue;
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
let mapping;
|
|
2413
|
+
let latinLetterId = `letter:${letter}`;
|
|
2414
|
+
const isStarting = i === 0;
|
|
2415
|
+
if (isStarting && letter === "O") {
|
|
2416
|
+
latinLetterId = `letter:${HEBREW_LETTERS.AIN}`;
|
|
2417
|
+
mapping = tree.getNode(latinLetterId);
|
|
2418
|
+
} else {
|
|
2419
|
+
mapping = tree.walk(latinLetterId, 2, "hebrewLetter").at(0);
|
|
2420
|
+
}
|
|
2421
|
+
const isEnding = i > 0 && i === letters.length - 1;
|
|
2422
|
+
if (mapping?.data) {
|
|
2423
|
+
let value = mapping.data.gematriaValue;
|
|
2424
|
+
if (isEnding && mapping.data.gematriaValueWhenEnding !== void 0) {
|
|
2425
|
+
value = mapping.data.gematriaValueWhenEnding;
|
|
2396
2426
|
}
|
|
2397
2427
|
presentGematriaNumbers.add(value);
|
|
2398
|
-
includedLetters.set(
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2428
|
+
includedLetters.set(latinLetterId, { letter, value, hebrewLetter: { id: mapping.id, data: mapping.data }, isVowel: isVowel(letter) });
|
|
2429
|
+
if (isVowel(letter)) {
|
|
2430
|
+
vowelsSum += value;
|
|
2431
|
+
} else {
|
|
2432
|
+
consonantsSum += value;
|
|
2433
|
+
}
|
|
2402
2434
|
}
|
|
2403
2435
|
}
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
}
|
|
2417
|
-
presentGematriaNumbers.add(value);
|
|
2418
|
-
includedLetters.set(mapping.id, { letter, value, hebrewLetter: mapping.data, isVowel: isVowel(letter) });
|
|
2419
|
-
if (isVowel(letter)) {
|
|
2420
|
-
vowelsSum += value;
|
|
2421
|
-
} else {
|
|
2422
|
-
consonantsSum += value;
|
|
2436
|
+
if (options?.calculateLetterPercentage) {
|
|
2437
|
+
const letterCount = letters.length;
|
|
2438
|
+
let vowelsCount = 0;
|
|
2439
|
+
let consonantsCount = 0;
|
|
2440
|
+
for (const letter of new Set(letters)) {
|
|
2441
|
+
const occurrences = letters.filter((l) => l === letter).length;
|
|
2442
|
+
letterPercentages.letters[letter] = occurrences / letterCount * 100;
|
|
2443
|
+
if (isVowel(letter)) {
|
|
2444
|
+
vowelsCount += occurrences;
|
|
2445
|
+
} else {
|
|
2446
|
+
consonantsCount += occurrences;
|
|
2447
|
+
}
|
|
2423
2448
|
}
|
|
2449
|
+
letterPercentages.percentageOfVowels = vowelsCount / letterCount * 100;
|
|
2450
|
+
letterPercentages.percentageOfConsonants = consonantsCount / letterCount * 100;
|
|
2424
2451
|
}
|
|
2425
2452
|
}
|
|
2426
2453
|
const vowelsReduction = reduceToSingleDigitWithSteps(vowelsSum);
|
|
@@ -2450,27 +2477,6 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
2450
2477
|
}
|
|
2451
2478
|
missingGematriaNumbers.sort((a, b) => a.number - b.number);
|
|
2452
2479
|
}
|
|
2453
|
-
const letterPercentages = {
|
|
2454
|
-
percentageOfVowels: 0,
|
|
2455
|
-
percentageOfConsonants: 0,
|
|
2456
|
-
letters: {}
|
|
2457
|
-
};
|
|
2458
|
-
if (options?.calculateLetterPercentage) {
|
|
2459
|
-
const letterCount = letters.length;
|
|
2460
|
-
let vowelsCount = 0;
|
|
2461
|
-
let consonantsCount = 0;
|
|
2462
|
-
for (const [_, letter] of includedLetters) {
|
|
2463
|
-
const occurrences = letters.filter((l) => l === letter.letter).length;
|
|
2464
|
-
letterPercentages.letters[letter.letter] = occurrences / letterCount * 100;
|
|
2465
|
-
if (letter.isVowel) {
|
|
2466
|
-
vowelsCount += occurrences;
|
|
2467
|
-
} else {
|
|
2468
|
-
consonantsCount += occurrences;
|
|
2469
|
-
}
|
|
2470
|
-
}
|
|
2471
|
-
letterPercentages.percentageOfVowels = vowelsCount / letterCount * 100;
|
|
2472
|
-
letterPercentages.percentageOfConsonants = consonantsCount / letterCount * 100;
|
|
2473
|
-
}
|
|
2474
2480
|
return {
|
|
2475
2481
|
vowels: {
|
|
2476
2482
|
originalSum: vowelsSum,
|