From d2a1c94d41873e36abb6e872ce345e80b9455e52 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Tue, 24 Nov 2020 23:56:50 +0100 Subject: group: add verbose flag --- fuzzycat/verify.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fuzzycat/verify.py b/fuzzycat/verify.py index e6310cb..98a1a26 100644 --- a/fuzzycat/verify.py +++ b/fuzzycat/verify.py @@ -132,14 +132,15 @@ class GroupVerifier: We would need to compare each possible pair and decide whether they are the same. """ - def __init__(self, iterable: collections.abc.Iterable, max_cluster_size: int = 10): + def __init__(self, iterable: collections.abc.Iterable, max_cluster_size: int = 10, verbose=True): self.iterable: collections.abc.Iterable = iterable self.max_cluster_size: int = 10 self.counter = collections.Counter() + self.verbose = verbose def run(self): for i, line in enumerate(self.iterable): - if i % 20000 == 0: + if i % 20000 == 0 and self.verbose: print(i, file=sys.stderr) line = line.strip() if not line: -- cgit v1.2.3