Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kavitharaju committed Nov 27, 2024
1 parent a989ee6 commit 1bd04eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions py-usfm-parser/src/usfm_grammar/list_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ def usj_to_bible_nlp_format(self, obj):
elif obj['type'] == "verse":
self.usj_to_list_v(obj)
marker_type = obj['type']
marker_name = obj['marker'] if "marker" in obj else ''
if marker_type == "USJ":
# This would occur if the JSON got flatttened after removing paragraph markers
marker_type = ""
if marker_type != "book" and 'content' in obj:
for item in obj['content']:
if isinstance(item, str):
if self.current_chapter == self.prev_chapter and self.current_verse==self.prev_verse:
if self.current_chapter == self.prev_chapter and \
self.current_verse==self.prev_verse:
self.bible_nlp_format["text"][-1] += " "+item.replace("\n", " ").strip()
else:
vref = f"{self.book} {self.current_chapter}:{self.current_verse}"
Expand All @@ -74,4 +74,3 @@ def usj_to_bible_nlp_format(self, obj):
self.prev_verse = self.current_verse
else:
self.usj_to_bible_nlp_format(item)

2 changes: 1 addition & 1 deletion py-usfm-parser/src/usfm_grammar/usfm_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def to_list(self,
return list_generator.list

def to_bible_nlp_format(self, ignore_errors=False):
'''uses the toUSJ function with BCV and TEXT filters,
'''uses the toUSJ function with BCV and TEXT filters,
and converts the JSON to lists of texts and vrefs.'''
if not ignore_errors and self.errors:
err_str = "\n\t".join([":".join(err) for err in self.errors])
Expand Down

0 comments on commit 1bd04eb

Please sign in to comment.