Spaces:
Running
Running
deveix
commited on
Commit
·
a707b10
1
Parent(s):
6c6cd07
fix main
Browse files- app/main.py +4 -3
app/main.py
CHANGED
@@ -122,15 +122,16 @@ def get_text_by_block_number(filepath, block_numbers):
|
|
122 |
|
123 |
for block_number, block in enumerate(blocks, 1): # Starting block numbers at 1 for human readability
|
124 |
if block_number in block_numbers:
|
|
|
125 |
splitted = block.split('\n')
|
126 |
ayah = splitted[0]
|
127 |
tafsir = splitted[1]
|
128 |
# Replace single newlines within blocks with space and strip leading/trailing whitespace
|
129 |
formatted_block = ' '.join(splitted).strip()
|
130 |
blocks_text.append({
|
131 |
-
ayah,
|
132 |
-
tafsir,
|
133 |
-
formatted_block
|
134 |
})
|
135 |
if len(blocks_text) == len(block_numbers): # Stop reading once all required blocks are retrieved
|
136 |
break
|
|
|
122 |
|
123 |
for block_number, block in enumerate(blocks, 1): # Starting block numbers at 1 for human readability
|
124 |
if block_number in block_numbers:
|
125 |
+
print(block)
|
126 |
splitted = block.split('\n')
|
127 |
ayah = splitted[0]
|
128 |
tafsir = splitted[1]
|
129 |
# Replace single newlines within blocks with space and strip leading/trailing whitespace
|
130 |
formatted_block = ' '.join(splitted).strip()
|
131 |
blocks_text.append({
|
132 |
+
ayah:ayah,
|
133 |
+
tafsir:tafsir,
|
134 |
+
block:formatted_block
|
135 |
})
|
136 |
if len(blocks_text) == len(block_numbers): # Stop reading once all required blocks are retrieved
|
137 |
break
|