{ "cells": [ { "cell_type": "markdown", "id": "faa22ee1-93fe-47e9-b2f0-e8516fe4eaec", "metadata": {}, "source": [ "# Hebrew Gematria" ] }, { "cell_type": "code", "execution_count": 1, "id": "6948d461-bb1f-4159-9517-1f63b9b17a4f", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The Gematria value for 'שלום' is 376\n" ] } ], "source": [ "# Function to calculate Gematria value for a Hebrew word\n", "def calculateGematria(word):\n", " gematriaValues = {\n", " 'א': 1, 'ב': 2, 'ג': 3, 'ד': 4, 'ה': 5, 'ו': 6, 'ז': 7, 'ח': 8,\n", " 'ט': 9, 'י': 10, 'כ': 20, 'ך': 20, 'ל': 30, 'מ': 40, 'ם': 40,\n", " 'נ': 50, 'ן': 50, 'ס': 60, 'ע': 70, 'פ': 80, 'ף': 80, 'צ': 90,\n", " 'ץ': 90, 'ק': 100, 'ר': 200, 'ש': 300, 'ת': 400\n", " }\n", "\n", " word = word[::-1] # Reverse the word for right-to-left calculation\n", " gematriaValue = sum(gematriaValues.get(letter, 0) for letter in word)\n", "\n", " return gematriaValue\n", "\n", "# Example usage\n", "hebrewWord = \"שלום\"\n", "gematriaResult = calculateGematria(hebrewWord)\n", "print(f\"The Gematria value for '{hebrewWord}' is {gematriaResult}\")" ] }, { "cell_type": "code", "execution_count": 3, "id": "36078e61-1116-46ed-9a9e-7d06da687336", "metadata": { "tags": [] }, "outputs": [], "source": [ "# To do: remove vowals.\n", "# question: can this be calculated based on ETCBC transliteration?" ] }, { "cell_type": "code", "execution_count": null, "id": "492ea52d-53ed-4bec-ac56-2e88a651fe02", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.5" } }, "nbformat": 4, "nbformat_minor": 5 }