mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Ignore Title Notes i.e notes with just headings from compute
This commit is contained in:
parent
d6d7b9d6a8
commit
181cab89d2
1 changed files with 6 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue