From 4be71ca3afe047c18eca9e86301618c4371e26ea Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Thu, 15 Dec 2022 15:30:35 +0800 Subject: [PATCH] update: multi-check process --- src/punctuation/check.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/punctuation/check.py b/src/punctuation/check.py index 63afaee..f71d4af 100755 --- a/src/punctuation/check.py +++ b/src/punctuation/check.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import os +import sys import json from itertools import product @@ -55,12 +56,16 @@ def pairsCheck(sentence: str) -> bool: if len(punctuationStack) != 0 or errorFlag: # something error in sentence for punctuation in reversed(punctuationStack): # replenish missing punctuation sentence.append(colorful(punctuation[1], 35)) - print(''.join(sentence)) + print('%s\n%s' % ('-' * 128, ''.join(sentence))) return False return True # no error match in sentence -data = loadContent('rc-3') -for row in data: - if not pairsCheck(row): - print() +def contentCheck(content: list) -> None: + for row in content: # pairs check + pairsCheck(row) + print('-' * 128) + # other check process + + +contentCheck(loadContent(sys.argv[1]))