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
package/dist/index.js
CHANGED
|
@@ -5843,49 +5843,76 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
5843
5843
|
tree = createTree({ system: SYSTEM2, parts: [] });
|
|
5844
5844
|
}
|
|
5845
5845
|
const includedLetters = /* @__PURE__ */ new Map();
|
|
5846
|
-
const
|
|
5846
|
+
const words = word.toUpperCase().trim().split(" ");
|
|
5847
5847
|
let vowelsSum = 0;
|
|
5848
5848
|
let consonantsSum = 0;
|
|
5849
5849
|
const presentGematriaNumbers = /* @__PURE__ */ new Set();
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5850
|
+
const letterPercentages = {
|
|
5851
|
+
percentageOfVowels: 0,
|
|
5852
|
+
percentageOfConsonants: 0,
|
|
5853
|
+
letters: {}
|
|
5854
|
+
};
|
|
5855
|
+
for (const word2 of words) {
|
|
5856
|
+
const letters = word2.split("");
|
|
5857
|
+
for (let i = 0; i < letters.length; i++) {
|
|
5858
|
+
const letter = letters[i].toLocaleUpperCase();
|
|
5859
|
+
const nextLetter = letters[i + 1]?.toLocaleLowerCase() || "";
|
|
5860
|
+
if (["P", "T", "K", "S", "C"].includes(letter) && nextLetter) {
|
|
5861
|
+
const combinedLetter = letter + nextLetter;
|
|
5862
|
+
const isEnding2 = i > 0 && i === letters.length - 2;
|
|
5863
|
+
const latinLetterId2 = `letter:${combinedLetter}`;
|
|
5864
|
+
const [mapping2] = tree.walk(latinLetterId2, 2, "hebrewLetter");
|
|
5865
|
+
if (mapping2?.data) {
|
|
5866
|
+
let value = mapping2.data.gematriaValue;
|
|
5867
|
+
if (isEnding2 && mapping2.data.gematriaValueWhenEnding !== void 0) {
|
|
5868
|
+
value = mapping2.data.gematriaValueWhenEnding;
|
|
5869
|
+
}
|
|
5870
|
+
presentGematriaNumbers.add(value);
|
|
5871
|
+
includedLetters.set(latinLetterId2, { letter: combinedLetter, value, hebrewLetter: { id: mapping2.id, data: mapping2.data }, isVowel: isVowel(letter) });
|
|
5872
|
+
consonantsSum += value;
|
|
5873
|
+
i++;
|
|
5874
|
+
continue;
|
|
5875
|
+
}
|
|
5876
|
+
}
|
|
5877
|
+
let mapping;
|
|
5878
|
+
let latinLetterId = `letter:${letter}`;
|
|
5879
|
+
const isStarting = i === 0;
|
|
5880
|
+
if (isStarting && letter === "O") {
|
|
5881
|
+
latinLetterId = `letter:${HEBREW_LETTERS.AIN}`;
|
|
5882
|
+
mapping = tree.getNode(latinLetterId);
|
|
5883
|
+
} else {
|
|
5884
|
+
mapping = tree.walk(latinLetterId, 2, "hebrewLetter").at(0);
|
|
5885
|
+
}
|
|
5886
|
+
const isEnding = i > 0 && i === letters.length - 1;
|
|
5887
|
+
if (mapping?.data) {
|
|
5888
|
+
let value = mapping.data.gematriaValue;
|
|
5889
|
+
if (isEnding && mapping.data.gematriaValueWhenEnding !== void 0) {
|
|
5890
|
+
value = mapping.data.gematriaValueWhenEnding;
|
|
5861
5891
|
}
|
|
5862
5892
|
presentGematriaNumbers.add(value);
|
|
5863
|
-
includedLetters.set(
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5893
|
+
includedLetters.set(latinLetterId, { letter, value, hebrewLetter: { id: mapping.id, data: mapping.data }, isVowel: isVowel(letter) });
|
|
5894
|
+
if (isVowel(letter)) {
|
|
5895
|
+
vowelsSum += value;
|
|
5896
|
+
} else {
|
|
5897
|
+
consonantsSum += value;
|
|
5898
|
+
}
|
|
5867
5899
|
}
|
|
5868
5900
|
}
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
}
|
|
5882
|
-
presentGematriaNumbers.add(value);
|
|
5883
|
-
includedLetters.set(mapping.id, { letter, value, hebrewLetter: mapping.data, isVowel: isVowel(letter) });
|
|
5884
|
-
if (isVowel(letter)) {
|
|
5885
|
-
vowelsSum += value;
|
|
5886
|
-
} else {
|
|
5887
|
-
consonantsSum += value;
|
|
5901
|
+
if (options?.calculateLetterPercentage) {
|
|
5902
|
+
const letterCount = letters.length;
|
|
5903
|
+
let vowelsCount = 0;
|
|
5904
|
+
let consonantsCount = 0;
|
|
5905
|
+
for (const letter of new Set(letters)) {
|
|
5906
|
+
const occurrences = letters.filter((l) => l === letter).length;
|
|
5907
|
+
letterPercentages.letters[letter] = occurrences / letterCount * 100;
|
|
5908
|
+
if (isVowel(letter)) {
|
|
5909
|
+
vowelsCount += occurrences;
|
|
5910
|
+
} else {
|
|
5911
|
+
consonantsCount += occurrences;
|
|
5912
|
+
}
|
|
5888
5913
|
}
|
|
5914
|
+
letterPercentages.percentageOfVowels = vowelsCount / letterCount * 100;
|
|
5915
|
+
letterPercentages.percentageOfConsonants = consonantsCount / letterCount * 100;
|
|
5889
5916
|
}
|
|
5890
5917
|
}
|
|
5891
5918
|
const vowelsReduction = reduceToSingleDigitWithSteps(vowelsSum);
|
|
@@ -5915,27 +5942,6 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
5915
5942
|
}
|
|
5916
5943
|
missingGematriaNumbers.sort((a, b) => a.number - b.number);
|
|
5917
5944
|
}
|
|
5918
|
-
const letterPercentages = {
|
|
5919
|
-
percentageOfVowels: 0,
|
|
5920
|
-
percentageOfConsonants: 0,
|
|
5921
|
-
letters: {}
|
|
5922
|
-
};
|
|
5923
|
-
if (options?.calculateLetterPercentage) {
|
|
5924
|
-
const letterCount = letters.length;
|
|
5925
|
-
let vowelsCount = 0;
|
|
5926
|
-
let consonantsCount = 0;
|
|
5927
|
-
for (const [_, letter] of includedLetters) {
|
|
5928
|
-
const occurrences = letters.filter((l) => l === letter.letter).length;
|
|
5929
|
-
letterPercentages.letters[letter.letter] = occurrences / letterCount * 100;
|
|
5930
|
-
if (letter.isVowel) {
|
|
5931
|
-
vowelsCount += occurrences;
|
|
5932
|
-
} else {
|
|
5933
|
-
consonantsCount += occurrences;
|
|
5934
|
-
}
|
|
5935
|
-
}
|
|
5936
|
-
letterPercentages.percentageOfVowels = vowelsCount / letterCount * 100;
|
|
5937
|
-
letterPercentages.percentageOfConsonants = consonantsCount / letterCount * 100;
|
|
5938
|
-
}
|
|
5939
5945
|
return {
|
|
5940
5946
|
vowels: {
|
|
5941
5947
|
originalSum: vowelsSum,
|