aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-11-24 23:56:50 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-11-24 23:56:50 +0100
commitd2a1c94d41873e36abb6e872ce345e80b9455e52 (patch)
tree102fa48fab428438b088be326785dde779922317
parent75a740a58e4cf5b8480261f0c2795960f66da4a9 (diff)
downloadfuzzycat-d2a1c94d41873e36abb6e872ce345e80b9455e52.tar.gz
fuzzycat-d2a1c94d41873e36abb6e872ce345e80b9455e52.zip
group: add verbose flag
-rw-r--r--fuzzycat/verify.py5
1 files 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: