Skip to content

Commit

Permalink
Release v1.0.3 (#112)
Browse files Browse the repository at this point in the history
* Fix for one-line heading in paragraph chunking algorithm
  • Loading branch information
jenniferjiangkells authored Jan 23, 2024
1 parent f5c5f6c commit dadea5b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/miade/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Note(object):
def __init__(self, text: str, regex_config_path: str = "./data/regex_para_chunk.csv"):
self.text = text
self.raw_text = text
self.regex_config = load_regex_config_mappings("./data/regex_para_chunk.csv")
self.regex_config = load_regex_config_mappings(regex_config_path)
self.paragraphs: Optional[List[Paragraph]] = []

def clean_text(self) -> None:
Expand Down Expand Up @@ -74,12 +74,9 @@ def get_paragraphs(self) -> None:
if match:
heading = match.group(1)
body = match.group(2)
if body == "":
body = heading
heading = ""
else:
heading = ""
body = text
heading = text
body = ""

end = start + len(text)
paragraph = Paragraph(heading=heading, body=body, type=paragraph_type, start=start, end=end)
Expand Down

0 comments on commit dadea5b

Please sign in to comment.