neuralworm commited on
Commit
26e9493
โ€ข
1 Parent(s): c160986
Files changed (2) hide show
  1. app.py +15 -13
  2. gematria.db +2 -2
app.py CHANGED
@@ -143,28 +143,30 @@ def search_gematria_in_db(c, gematria_sum):
143
 
144
  def run_test():
145
  debug_output = []
146
- test_phrase = "ืื—ืจ ื•ืืชื‘ื ื™ืžื™ืŸ ื•ืื ื™"
147
- expected_gematria = 1495
148
 
149
  def debug_callback(message):
150
  debug_output.append(message)
151
  logging.info(message)
152
 
153
  # Load the test JSON contents for 01.json
154
- test_texts_00 = process_json_files(0, 0)
155
- test_texts_01 = process_json_files(1, 1)
156
- populate_database(test_texts_00, max_phrase_length=22) # Populate the database from book 0 with phrases up to 22 words
157
- populate_database(test_texts_01, max_phrase_length=3) # Populate the database from book 1 with phrases up to 3 words
158
- conn = sqlite3.connect('gematria.db')
159
- c = conn.cursor()
160
- matching_phrases_01 = search_gematria_in_db(c, expected_gematria)
161
- conn.close()
162
  #assert matching_phrases_01[0][0] == test_phrase, f"Found phrase does not match: {matching_phrases_01[0][0]}"
163
- print("Test successful: The phrase was correctly found and the gematria matches in 01.json.")
164
- print("\n".join(debug_output))
165
 
166
  test_texts = process_json_files(1, 39)
167
- populate_database(test_texts, max_phrase_length=2)
 
 
168
 
169
  iface = gr.Interface(
170
  fn=gematria_search_interface,
 
143
 
144
  def run_test():
145
  debug_output = []
146
+ #test_phrase = "ืื—ืจ ื•ืืชื‘ื ื™ืžื™ืŸ ื•ืื ื™"
147
+ #expected_gematria = 1495
148
 
149
  def debug_callback(message):
150
  debug_output.append(message)
151
  logging.info(message)
152
 
153
  # Load the test JSON contents for 01.json
154
+ #test_texts_00 = process_json_files(0, 0)
155
+ #test_texts_01 = process_json_files(1, 1)
156
+ #populate_database(test_texts_00, max_phrase_length=22) # Populate the database from book 0 with phrases up to 22 words
157
+ #populate_database(test_texts_01, max_phrase_length=3) # Populate the database from book 1 with phrases up to 3 words
158
+ #conn = sqlite3.connect('gematria.db')
159
+ #c = conn.cursor()
160
+ #matching_phrases_01 = search_gematria_in_db(c, expected_gematria)
161
+ #conn.close()
162
  #assert matching_phrases_01[0][0] == test_phrase, f"Found phrase does not match: {matching_phrases_01[0][0]}"
163
+ #print("Test successful: The phrase was correctly found and the gematria matches in 01.json.")
164
+ #print("\n".join(debug_output))
165
 
166
  test_texts = process_json_files(1, 39)
167
+ populate_database(test_texts, max_phrase_length=1)
168
+ #populate_database(test_texts, max_phrase_length=2)
169
+ #populate_database(test_texts, max_phrase_length=3)
170
 
171
  iface = gr.Interface(
172
  fn=gematria_search_interface,
gematria.db CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:42149cb9e6ef917c121a5f8cb3d44ab03cfd9770b2e7818715b326f12b5bb65e
3
- size 44187648
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a70de31a4b4d75fe746acc35d7567274615330a7e98872ee123f9cff3a51b38c
3
+ size 44244992