Skip to content

Commit

Permalink
Fix paragraphs
Browse files Browse the repository at this point in the history
When sentence was being split, the paragraph identifier was being
wrongly printed multiple times
  • Loading branch information
cgr71ii committed Feb 15, 2022
1 parent 276cc2c commit 0c168cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bifixer/monofixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ def fix_sentences(args):
new_parts[args.sdeferredcol-1] = parts[args.sdeferredcol-1].rstrip("\n")+"#"+str(sent_num)

if args.sparagraphid:
if "#" in parts[args.sparagraphid-1]:
new_parts[args.sparagraphid-1] = parts[args.sparagraphid-1].rstrip("\n").split("#")[0]+"#"+str(sent_num)
else:
new_parts[args.sparagraphid-1] = parts[args.sparagraphid-1].rstrip("\n")+"#"+str(sent_num)

if (new_parts[args.scol-1]): #sentence may be empty now because it contained only spaces or similar weird thing
Expand Down

0 comments on commit 0c168cc

Please sign in to comment.