Skip to content

Commit b95f56f

Browse files
committed
fix sent philo_id extraction
1 parent 1399ef5 commit b95f56f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

text_preprocessing/preprocessor.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,11 @@ def process_philo_text(cls, text: str, fetch_metadata: bool = True):
401401
text_path,
402402
text,
403403
)
404+
if cls.text_object_type == "sent":
405+
obj_metadata["philo_id"] = " ".join(
406+
current_text_object[0][1]["position"].split()[:6] + ["0"]
407+
)
408+
obj_metadata["philo_type"] = "sent"
404409
metadata.append(obj_metadata)
405410
else:
406411
metadata.append(os.path.basename(text))
@@ -428,6 +433,9 @@ def process_philo_text(cls, text: str, fetch_metadata: bool = True):
428433
text_path,
429434
text,
430435
)
436+
if cls.text_object_type == "sent":
437+
obj_metadata["philo_id"] = " ".join(current_text_object[0][1]["position"].split()[:6] + ["0"])
438+
obj_metadata["philo_type"] = "sent"
431439
metadata.append(obj_metadata)
432440
docs.append(current_text_object)
433441
sent_starts_list.append(sent_starts)

0 commit comments

Comments
 (0)