Added JSONL open check

isaac
Pavan Mandava 5 years ago
parent 7d52d0629b
commit 3916df452f

@ -75,7 +75,8 @@ class DataReaderJsonLines:
This method opens the file, reads every line and returns a collection of lines
:return: collection of Citation Objects, with the required data
"""
for line in jsonlines.open(self.file_path):
with jsonlines.open(self.file_path) as jl_reader:
for line in jl_reader:
yield read_json_line(line)

Loading…
Cancel
Save