Spaces:
Sleeping
Sleeping
Ignore readable messages that contains non-ASCII
Browse files- analyse.py +6 -2
analyse.py
CHANGED
@@ -41,9 +41,13 @@ def load_msgs(msg_lens: list[int], file: str | None = None):
|
|
41 |
)
|
42 |
msgs["random"].append(base64_msg)
|
43 |
|
44 |
-
|
45 |
-
while len(readable_msg) < length:
|
46 |
readable_msg = next(iterator)["text"]
|
|
|
|
|
|
|
|
|
|
|
47 |
msgs["readable"].append(readable_msg[:length])
|
48 |
|
49 |
return msgs
|
|
|
41 |
)
|
42 |
msgs["random"].append(base64_msg)
|
43 |
|
44 |
+
while True:
|
|
|
45 |
readable_msg = next(iterator)["text"]
|
46 |
+
try :
|
47 |
+
readable_msg[:length].encode("ascii")
|
48 |
+
break
|
49 |
+
except Exception as e:
|
50 |
+
continue
|
51 |
msgs["readable"].append(readable_msg[:length])
|
52 |
|
53 |
return msgs
|