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.mjs
CHANGED
|
@@ -5807,49 +5807,76 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
5807
5807
|
tree = createTree({ system: SYSTEM2, parts: [] });
|
|
5808
5808
|
}
|
|
5809
5809
|
const includedLetters = /* @__PURE__ */ new Map();
|
|
5810
|
-
const
|
|
5810
|
+
const words = word.toUpperCase().trim().split(" ");
|
|
5811
5811
|
let vowelsSum = 0;
|
|
5812
5812
|
let consonantsSum = 0;
|
|
5813
5813
|
const presentGematriaNumbers = /* @__PURE__ */ new Set();
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5814
|
+
const letterPercentages = {
|
|
5815
|
+
percentageOfVowels: 0,
|
|
5816
|
+
percentageOfConsonants: 0,
|
|
5817
|
+
letters: {}
|
|
5818
|
+
};
|
|
5819
|
+
for (const word2 of words) {
|
|
5820
|
+
const letters = word2.split("");
|
|
5821
|
+
for (let i = 0; i < letters.length; i++) {
|
|
5822
|
+
const letter = letters[i].toLocaleUpperCase();
|
|
5823
|
+
const nextLetter = letters[i + 1]?.toLocaleLowerCase() || "";
|
|
5824
|
+
if (["P", "T", "K", "S", "C"].includes(letter) && nextLetter) {
|
|
5825
|
+
const combinedLetter = letter + nextLetter;
|
|
5826
|
+
const isEnding2 = i > 0 && i === letters.length - 2;
|
|
5827
|
+
const latinLetterId2 = `letter:${combinedLetter}`;
|
|
5828
|
+
const [mapping2] = tree.walk(latinLetterId2, 2, "hebrewLetter");
|
|
5829
|
+
if (mapping2?.data) {
|
|
5830
|
+
let value = mapping2.data.gematriaValue;
|
|
5831
|
+
if (isEnding2 && mapping2.data.gematriaValueWhenEnding !== void 0) {
|
|
5832
|
+
value = mapping2.data.gematriaValueWhenEnding;
|
|
5833
|
+
}
|
|
5834
|
+
presentGematriaNumbers.add(value);
|
|
5835
|
+
includedLetters.set(latinLetterId2, { letter: combinedLetter, value, hebrewLetter: { id: mapping2.id, data: mapping2.data }, isVowel: isVowel(letter) });
|
|
5836
|
+
consonantsSum += value;
|
|
5837
|
+
i++;
|
|
5838
|
+
continue;
|
|
5839
|
+
}
|
|
5840
|
+
}
|
|
5841
|
+
let mapping;
|
|
5842
|
+
let latinLetterId = `letter:${letter}`;
|
|
5843
|
+
const isStarting = i === 0;
|
|
5844
|
+
if (isStarting && letter === "O") {
|
|
5845
|
+
latinLetterId = `letter:${HEBREW_LETTERS.AIN}`;
|
|
5846
|
+
mapping = tree.getNode(latinLetterId);
|
|
5847
|
+
} else {
|
|
5848
|
+
mapping = tree.walk(latinLetterId, 2, "hebrewLetter").at(0);
|
|
5849
|
+
}
|
|
5850
|
+
const isEnding = i > 0 && i === letters.length - 1;
|
|
5851
|
+
if (mapping?.data) {
|
|
5852
|
+
let value = mapping.data.gematriaValue;
|
|
5853
|
+
if (isEnding && mapping.data.gematriaValueWhenEnding !== void 0) {
|
|
5854
|
+
value = mapping.data.gematriaValueWhenEnding;
|
|
5825
5855
|
}
|
|
5826
5856
|
presentGematriaNumbers.add(value);
|
|
5827
|
-
includedLetters.set(
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5857
|
+
includedLetters.set(latinLetterId, { letter, value, hebrewLetter: { id: mapping.id, data: mapping.data }, isVowel: isVowel(letter) });
|
|
5858
|
+
if (isVowel(letter)) {
|
|
5859
|
+
vowelsSum += value;
|
|
5860
|
+
} else {
|
|
5861
|
+
consonantsSum += value;
|
|
5862
|
+
}
|
|
5831
5863
|
}
|
|
5832
5864
|
}
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
}
|
|
5846
|
-
presentGematriaNumbers.add(value);
|
|
5847
|
-
includedLetters.set(mapping.id, { letter, value, hebrewLetter: mapping.data, isVowel: isVowel(letter) });
|
|
5848
|
-
if (isVowel(letter)) {
|
|
5849
|
-
vowelsSum += value;
|
|
5850
|
-
} else {
|
|
5851
|
-
consonantsSum += value;
|
|
5865
|
+
if (options?.calculateLetterPercentage) {
|
|
5866
|
+
const letterCount = letters.length;
|
|
5867
|
+
let vowelsCount = 0;
|
|
5868
|
+
let consonantsCount = 0;
|
|
5869
|
+
for (const letter of new Set(letters)) {
|
|
5870
|
+
const occurrences = letters.filter((l) => l === letter).length;
|
|
5871
|
+
letterPercentages.letters[letter] = occurrences / letterCount * 100;
|
|
5872
|
+
if (isVowel(letter)) {
|
|
5873
|
+
vowelsCount += occurrences;
|
|
5874
|
+
} else {
|
|
5875
|
+
consonantsCount += occurrences;
|
|
5876
|
+
}
|
|
5852
5877
|
}
|
|
5878
|
+
letterPercentages.percentageOfVowels = vowelsCount / letterCount * 100;
|
|
5879
|
+
letterPercentages.percentageOfConsonants = consonantsCount / letterCount * 100;
|
|
5853
5880
|
}
|
|
5854
5881
|
}
|
|
5855
5882
|
const vowelsReduction = reduceToSingleDigitWithSteps(vowelsSum);
|
|
@@ -5879,27 +5906,6 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
5879
5906
|
}
|
|
5880
5907
|
missingGematriaNumbers.sort((a, b) => a.number - b.number);
|
|
5881
5908
|
}
|
|
5882
|
-
const letterPercentages = {
|
|
5883
|
-
percentageOfVowels: 0,
|
|
5884
|
-
percentageOfConsonants: 0,
|
|
5885
|
-
letters: {}
|
|
5886
|
-
};
|
|
5887
|
-
if (options?.calculateLetterPercentage) {
|
|
5888
|
-
const letterCount = letters.length;
|
|
5889
|
-
let vowelsCount = 0;
|
|
5890
|
-
let consonantsCount = 0;
|
|
5891
|
-
for (const [_, letter] of includedLetters) {
|
|
5892
|
-
const occurrences = letters.filter((l) => l === letter.letter).length;
|
|
5893
|
-
letterPercentages.letters[letter.letter] = occurrences / letterCount * 100;
|
|
5894
|
-
if (letter.isVowel) {
|
|
5895
|
-
vowelsCount += occurrences;
|
|
5896
|
-
} else {
|
|
5897
|
-
consonantsCount += occurrences;
|
|
5898
|
-
}
|
|
5899
|
-
}
|
|
5900
|
-
letterPercentages.percentageOfVowels = vowelsCount / letterCount * 100;
|
|
5901
|
-
letterPercentages.percentageOfConsonants = consonantsCount / letterCount * 100;
|
|
5902
|
-
}
|
|
5903
5909
|
return {
|
|
5904
5910
|
vowels: {
|
|
5905
5911
|
originalSum: vowelsSum,
|