From 181cab89d223b453531503816c7344f947e5c6ec Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 4 Aug 2021 18:29:22 -0700 Subject: [PATCH] Ignore Title Notes i.e notes with just headings from compute --- asymmetric.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/asymmetric.py b/asymmetric.py index b00796d0..957f7aa8 100644 --- a/asymmetric.py +++ b/asymmetric.py @@ -25,7 +25,12 @@ def extract_entries(notesfile, verbose=False): with gzip.open(str(notesfile.expanduser()), 'rt', encoding='utf8') as jsonl: for line in jsonl: note = json.loads(line.strip()) - note_string = f'{note["Title"]}\n{note["Body"] if "Body" in note else ""}' + + # Ignore title notes i.e notes with just headings and empty body + if not "Body" in note or note["Body"].strip() == "": + continue + + note_string = f'{note["Title"]}\t{note["Tags"] if "Tags" in note else ""}\n{note["Body"] if "Body" in note else ""}' entries.extend([note_string]) if verbose: