📅  最后修改于: 2023-12-03 15:30:53.345000             🧑  作者: Mango
Gematria is an ancient Jewish numerical system where each letter of the Hebrew alphabet is assigned a numerical value. Gematria Python is a Python module that helps you use this system and interpret the numerical values of Hebrew words and phrases.
To install Gematria Python, use pip:
pip install gematria
The gematria
module provides two functions:
gematria.gematria(word: str) -> int
: Returns the numerical value of a given word in Hebrew.gematria.word_value(word: str) -> Dict[str, int]
: Returns a dictionary with the numerical value of each letter in a given word in Hebrew.import gematria
word = "חיים" # Hebrew word for "life"
value = gematria.gematria(word)
print(f"The Gematria value of {word} is {value}")
# Output: The Gematria value of חיים is 68
letters_value = gematria.word_value(word)
print(f"The numerical value of each letter in {word} is {letters_value}")
# Output: The numerical value of each letter in חיים is {'ח': 8, 'י': 20, 'י': 20, 'ם': 20}