From b6380364b946ed5dc108712bc0b00fb97afc5596 Mon Sep 17 00:00:00 2001 From: jenniferjiangkells Date: Tue, 30 Jul 2024 18:07:00 +0100 Subject: [PATCH] Fix tests --- src/miade/annotators.py | 2 +- tests/test_note.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/miade/annotators.py b/src/miade/annotators.py index e0e6ef6..b42876d 100644 --- a/src/miade/annotators.py +++ b/src/miade/annotators.py @@ -355,7 +355,7 @@ def preprocess(self, note: Note, refine: bool = True) -> Note: Args: note (Note): The input note to preprocess. refine (bool): Whether to refine the paragraph detection algorithm and allow merging of continuous prose - paragraphs, merging to paragraphs with empty bodies with the next prose paragraphs + paragraphs, merging to paragraphs with empty bodies with the next prose paragraphs. Default True. Returns: The preprocessed note. diff --git a/tests/test_note.py b/tests/test_note.py index 28efdf0..22b338e 100644 --- a/tests/test_note.py +++ b/tests/test_note.py @@ -10,9 +10,11 @@ ) -def test_note_cleaning_and_paragraphing(test_problems_medcat_model, test_clean_and_paragraphing_note): +def test_note_cleaning_and_paragraphing_naive(test_problems_medcat_model, test_clean_and_paragraphing_note): annotator = ProblemsAnnotator(test_problems_medcat_model) - annotator.preprocess(test_clean_and_paragraphing_note) + annotator.preprocess(test_clean_and_paragraphing_note, refine=False) + for paragraph in test_clean_and_paragraphing_note.paragraphs: + print(paragraph) assert test_clean_and_paragraphing_note.paragraphs == [ Paragraph(heading="", body="", type=ParagraphType.prose, start=0, end=182),