import json
# Implementemos la función de temurah con el alfabeto completo y probemos la conversión de "Baphomet" a "Sofia"
# en hebreo usando temurah. 
# Nota: La representación exacta de "Baphomet" y "Sofia" en hebreo puede variar debido a interpretaciones,
# pero aquí usaremos transliteraciones aproximadas para ilustrar cómo podría hacerse.

def temurah(text, hebrew_alphabet='אבגדהוזחטיכלמנסעפצקרשת', reverse=False):
    """
    Aplica la temurah a un texto hebreo utilizando todo el alfabeto hebreo.
    El esquema de ejemplo simplemente invierte el orden del alfabeto.
    """
    # Invertir el alfabeto si se solicita
    if reverse:
        hebrew_alphabet = hebrew_alphabet[::-1]

    # Generar el alfabeto invertido
    inverted_alphabet = hebrew_alphabet[::-1]
    
    # Crear el diccionario de mapeo para temurah
    temurah_mapping = {orig: inv for orig, inv in zip(hebrew_alphabet, inverted_alphabet)}
    
    # Aplicar temurah al texto
    temurah_text = ''.join(temurah_mapping.get(char, char) for char in text)
    
    return temurah_text

# Definir el alfabeto hebreo
hebrew_alphabet = 'אבגדהוזחטיכלמנסעפצקרשת'

# Texto de ejemplo: "Baphomet" y "Sofia" en hebreo
# Es importante notar que la transliteración directa de nombres propios o términos específicos entre idiomas
# puede no ser directa o puede requerir ajustes basados en la fonética o el uso histórico.

# Por simplificación, supongamos transliteraciones hipotéticas para "Baphomet" a "Sofia":
# Estas transliteraciones son ejemplos y pueden no reflejar transliteraciones precisas.
baphomet_hebrew = 'בפומת'  # Esta es una transliteración hipotética para "Baphomet"
sofia_hebrew = 'סופיא'  # Esta es una transliteración hipotética para "Sofia"


jesus ="ישוע"
christ = ""

print(temurah(jesus,hebrew_alphabet))
# Aplicar temurah al texto hipotético de "Baphomet"
temurah_baphomet = temurah(baphomet_hebrew, hebrew_alphabet)

# Mostrar resultados

print(temurah_baphomet+"\n"+sofia_hebrew)




genesis = json.loads(open("genesis.json","r").read())["text"][0]

##example_text = "בראשית ברא אלהים את השמים ואת הארץ"  # "En el principio Dios creó los cielos y la tierra."
#for txt in genesis:
#    print(temurah(txt,hebrew_alphabet))