neuralworm commited on
Commit
3f8c999
·
1 Parent(s): 6d08b4f

fix els length bug

Browse files
Files changed (2) hide show
  1. els_cache.db +0 -3
  2. quran.py +5 -8
els_cache.db DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0a004526012b982e2de91216dd0b4c155170f37a6ed3ff72d56f904583784a72
3
- size 28672
 
 
 
 
quran.py CHANGED
@@ -243,14 +243,11 @@ def get_first_els_result_quran(gematria_sum: int, tlang: str = "en") -> Dict[str
243
  positions = []
244
  pos = start_pos
245
 
246
- # Extract up to 7 characters (typical ELS result length)
247
- for _ in range(7):
248
- if pos < len(text_no_spaces):
249
- extracted += text_no_spaces[pos]
250
- positions.append(pos)
251
- pos += gematria_sum
252
- else:
253
- break
254
 
255
  if len(extracted) >= 3: # At least 3 characters
256
  # Look up the sura/verse for the first and last character
 
243
  positions = []
244
  pos = start_pos
245
 
246
+ # Extract until the end of the text is reached
247
+ while pos < len(text_no_spaces):
248
+ extracted += text_no_spaces[pos]
249
+ positions.append(pos)
250
+ pos += gematria_sum
 
 
 
251
 
252
  if len(extracted) >= 3: # At least 3 characters
253
  # Look up the sura/verse for the first and last character