From ef91b2fca7e08b09e99db7844430ae1dd9aea6f2 Mon Sep 17 00:00:00 2001 From: surtur Date: Thu, 16 Dec 2021 03:13:46 +0100 Subject: [PATCH] import just what's needed --- da_detector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/da_detector.py b/da_detector.py index 1a8293c..af4930b 100644 --- a/da_detector.py +++ b/da_detector.py @@ -10,10 +10,10 @@ class da_detector: self.langs_to_check = ["cz", "sk", "de", "en", "fr"] def rm_interpunction(data): - import string + from string import punctuation for ngram in data: try: - ngram = ngram.translate(str.maketrans('', '', string.punctuation)) + ngram = ngram.translate(str.maketrans('', '', punctuation)) except Exception as e: raise e