Spaces:
Runtime error
Runtime error
cryptocalypse
commited on
Commit
•
8fcbe57
1
Parent(s):
ab81465
ziruph
Browse files- app.py +18 -7
- lib/notarikon.py +4 -0
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
from lib.gematria import calculate_gematria, strip_diacritics
|
4 |
from lib.temuraeh import temura_conv
|
5 |
-
|
6 |
|
7 |
from torahcodes.resources.func.torah import *
|
8 |
torah = Torah()
|
@@ -32,7 +32,8 @@ def temurae(textA,lang):
|
|
32 |
|
33 |
def ziruph(dic,text):
|
34 |
|
35 |
-
return text
|
|
|
36 |
def gematria_sum(text):
|
37 |
els_space = torah.gematria_sum(text)
|
38 |
if els_space==0:
|
@@ -156,11 +157,21 @@ with gr.Blocks(title="Sophia, Torah Codes") as demo:
|
|
156 |
|
157 |
with gr.Tab("Ziruph"):
|
158 |
with gr.Row():
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
with gr.Tab("Files"):
|
165 |
with gr.Row():
|
166 |
image_input = gr.Image()
|
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
from lib.gematria import calculate_gematria, strip_diacritics
|
4 |
from lib.temuraeh import temura_conv
|
5 |
+
from lib.notarikon import notarikon
|
6 |
|
7 |
from torahcodes.resources.func.torah import *
|
8 |
torah = Torah()
|
|
|
32 |
|
33 |
def ziruph(dic,text):
|
34 |
|
35 |
+
return (notarikon(text,"first"),notarikon(text,"last"))
|
36 |
+
|
37 |
def gematria_sum(text):
|
38 |
els_space = torah.gematria_sum(text)
|
39 |
if els_space==0:
|
|
|
157 |
|
158 |
with gr.Tab("Ziruph"):
|
159 |
with gr.Row():
|
160 |
+
zir_text = gr.Textbox(label="Text to encode with Temurah / Atbash algorihm",scale=3)
|
161 |
+
dictionary_zir=gr.Dropdown(
|
162 |
+
["Kircher", "Random", "Custom"],value="Latin",scale=1; label="Gematria Alphabet", info="Choose gematria conversion"
|
163 |
+
),
|
164 |
+
custom_dic = fr.TextBox(label="Custom Dictionary",scale=3)
|
165 |
+
zir_btn = gr.Button("Encrypt",scale=1)
|
166 |
+
with gr.Row():
|
167 |
+
zir_result = gr.TextBox(label="Results")
|
168 |
+
|
169 |
+
zir_btn.click(
|
170 |
+
ziruph,
|
171 |
+
inputs=[zir_text,zir_text],
|
172 |
+
outputs=zir_result
|
173 |
+
)
|
174 |
+
|
175 |
with gr.Tab("Files"):
|
176 |
with gr.Row():
|
177 |
image_input = gr.Image()
|
lib/notarikon.py
CHANGED
@@ -27,6 +27,9 @@ def notarikon(text, mode='first'):
|
|
27 |
|
28 |
return notarikon_result
|
29 |
|
|
|
|
|
|
|
30 |
# Ejemplo de uso
|
31 |
#genesis = open("genesis.json","rb").read()
|
32 |
genesis = json.loads(open("genesis.json","r").read())["text"][0]
|
@@ -38,3 +41,4 @@ for txt in genesis:
|
|
38 |
notarikon_result_last = notarikon(txt, mode='last')
|
39 |
|
40 |
print(notarikon_result_first, notarikon_result_last)
|
|
|
|
27 |
|
28 |
return notarikon_result
|
29 |
|
30 |
+
|
31 |
+
|
32 |
+
"""
|
33 |
# Ejemplo de uso
|
34 |
#genesis = open("genesis.json","rb").read()
|
35 |
genesis = json.loads(open("genesis.json","r").read())["text"][0]
|
|
|
41 |
notarikon_result_last = notarikon(txt, mode='last')
|
42 |
|
43 |
print(notarikon_result_first, notarikon_result_last)
|
44 |
+
"""
|