update content_summary in chunking
Browse files
app/law_document_chunker.py
CHANGED
|
@@ -210,14 +210,10 @@ class LawDocumentChunker:
|
|
| 210 |
|
| 211 |
current_priority = level_priority.get(current_level, 999)
|
| 212 |
|
| 213 |
-
# Tìm tất cả ancestors từ
|
| 214 |
-
for i in range(
|
| 215 |
chunk_id, level, level_value, content = chunk_stack[i]
|
| 216 |
|
| 217 |
-
# Dừng khi gặp chunk hiện tại
|
| 218 |
-
if chunk_id == parent_id:
|
| 219 |
-
break
|
| 220 |
-
|
| 221 |
# Tìm tất cả chunks Điều xuất hiện trước chunk hiện tại
|
| 222 |
if level == "DIEU":
|
| 223 |
ancestors.append((level, level_value, content))
|
|
|
|
| 210 |
|
| 211 |
current_priority = level_priority.get(current_level, 999)
|
| 212 |
|
| 213 |
+
# Tìm tất cả ancestors từ index trước chunk hiện tại
|
| 214 |
+
for i in range(parent_index - 1, -1, -1):
|
| 215 |
chunk_id, level, level_value, content = chunk_stack[i]
|
| 216 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
# Tìm tất cả chunks Điều xuất hiện trước chunk hiện tại
|
| 218 |
if level == "DIEU":
|
| 219 |
ancestors.append((level, level_value, content))
|