Hebrew Gematria¶
A Hebrew gematria engine that deterministically sums the standard letter values (mispar hechrachi, 1-400) of a Hebrew name. Niqqud are stripped and unsupported characters are rejected. Because gematria compares raw totals, the total is stamped in the selection modifiers over a single structural result symbol; standard versus mispar gadol finals (500-900) is configurable.
from fortune_telling_core import Querent, ReadingRequest
from fortune_telling_core.traditions.hebrew_gematria import (
HEBREW_GEMATRIA_DECK,
HEBREW_GEMATRIA_SPREAD,
build_engine,
)
request = ReadingRequest(
deck_id=HEBREW_GEMATRIA_DECK.id,
spread_id=HEBREW_GEMATRIA_SPREAD.id,
querent=Querent(id="sample", display_name="Sample", attributes={"name": "שלום"}),
)
reading = build_engine().cast(request)
# reading.summary -> "Gematria total 376."
hebrew_gematria ¶
HEBREW_GEMATRIA_DECK
module-attribute
¶
HEBREW_GEMATRIA_DECK = Deck(
id="hebrew_gematria.deck.total.v1",
symbols=(
Symbol(
id=HEBREW_GEMATRIA_RESULT_SYMBOL,
name="Gematria Total",
attributes={"kind": "raw_total"},
),
),
)
HEBREW_GEMATRIA_SPREAD
module-attribute
¶
HEBREW_GEMATRIA_SPREAD = Spread(
id="hebrew_gematria.spread.name.v1",
name="Hebrew Gematria Total",
positions=(
Position(
"total",
"Total",
"The summed gematria value of the name.",
),
),
)
FinalLetterMode ¶
Bases: StrEnum
How the five Hebrew final forms (sofit) are valued.
STANDARD gives each final form the same value as its base letter.
GADOL (mispar gadol) gives the final forms the values 500-900.
HebrewGematriaEngine ¶
Bases: AbstractEngine
Hebrew gematria engine.
The engine deterministically sums the standard gematria values of a Hebrew name. Gematria compares raw totals rather than reducing to a single digit, so the total is the symbol-bearing value and is stamped into the selection modifiers over a single structural result symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
final_letter_mode
|
FinalLetterMode
|
Default treatment of final forms (sofit) when the
request does not specify |
STANDARD
|
Source code in src/fortune_telling_core/traditions/hebrew_gematria/engine.py
deck ¶
Return the Hebrew gematria deck.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request whose |
required |
Returns:
| Type | Description |
|---|---|
Deck
|
The bundled deck. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the requested deck is unsupported. |
Source code in src/fortune_telling_core/traditions/hebrew_gematria/engine.py
spread ¶
Return the Hebrew gematria spread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request whose |
required |
Returns:
| Type | Description |
|---|---|
Spread
|
The bundled spread. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the requested spread is unsupported. |
Source code in src/fortune_telling_core/traditions/hebrew_gematria/engine.py
draw ¶
Compute the gematria total as a deterministic draw.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request with |
required |
rng
|
Rng
|
Ignored. The argument is present for |
required |
Returns:
| Type | Description |
|---|---|
Draw
|
A draw with the single total selection. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the name is missing, has no Hebrew letters, or
|
Source code in src/fortune_telling_core/traditions/hebrew_gematria/engine.py
cast ¶
Compute a Hebrew gematria reading without a caller RNG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReadingRequest
|
Reading request containing the name and optional configuration. |
required |
Returns:
| Type | Description |
|---|---|
Reading
|
A reading with the total placement and structural summary. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the name or options are invalid. |
Source code in src/fortune_telling_core/traditions/hebrew_gematria/engine.py
build_engine ¶
build_engine(
*,
final_letter_mode: FinalLetterMode = FinalLetterMode.STANDARD,
) -> HebrewGematriaEngine
Create a Hebrew gematria engine.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
final_letter_mode
|
FinalLetterMode
|
Default treatment of final forms (sofit). |
STANDARD
|
Returns:
| Type | Description |
|---|---|
HebrewGematriaEngine
|
A new |