From 2383be3ba4226a581899999bdce124b51ff6a987 Mon Sep 17 00:00:00 2001 From: Martin Bernstorff Date: Tue, 9 Apr 2024 14:18:43 +0200 Subject: [PATCH] fix: do not quote the divider in highlights (#138) --- memorymarker/question_generator/main.py | 2 +- memorymarker/question_generator/reasoned_highlight.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/memorymarker/question_generator/main.py b/memorymarker/question_generator/main.py index 7b15bfb..10e5725 100644 --- a/memorymarker/question_generator/main.py +++ b/memorymarker/question_generator/main.py @@ -81,7 +81,7 @@ def chunk_highlights( for i in range(0, len(group[1]), 5): subset: Sequence["Highlights"] = group[1][i : i + chunk_size] - combined_text = "\n---".join( + combined_text = "\n---\n".join( f"> {_.prefix}{_.highlighted_text}{_.suffix}" for _ in subset ) diff --git a/memorymarker/question_generator/reasoned_highlight.py b/memorymarker/question_generator/reasoned_highlight.py index 4adab3f..b22a010 100644 --- a/memorymarker/question_generator/reasoned_highlight.py +++ b/memorymarker/question_generator/reasoned_highlight.py @@ -13,11 +13,6 @@ class SourceDocument: uri: str -def to_markdown_quote(text: str) -> str: - lines = [f"> {line}" for line in text.splitlines()] - return "\n".join(lines) - - class Highlights(BaseModel): source_document: SourceDocument