From 53bd35c9c1bfdaabb277da35ef244dacdd23f1be Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Thu, 15 Dec 2022 18:36:56 +0800 Subject: [PATCH] update: skip space character check in caption --- src/punctuation/check.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/punctuation/check.py b/src/punctuation/check.py index 29fa9ae..2b239e9 100755 --- a/src/punctuation/check.py +++ b/src/punctuation/check.py @@ -25,8 +25,7 @@ endingPunctuations = [ # '—', warningPunctuations = [ - # ' ', - '-', '·', '.', ';', + ' ', '-', '·', '.', ';', ] defaultPath = os.path.join( @@ -92,6 +91,8 @@ def endingCheck(sentence: str) -> bool: def existCheck(sentence: str) -> bool: + if isCaption(sentence): # skip caption + return True flag = False for warningPunctuation in warningPunctuations: if warningPunctuation in sentence: @@ -116,7 +117,7 @@ def contentCheck(content: list) -> None: print('-' * 128) # split line flag = True - for row in content: # ending check + for row in content: # exist check flag &= existCheck(row) if not flag: print('-' * 128) # split line