Add misc cleaning scripts for t0txt

This commit is contained in:
2022-06-20 00:53:56 +00:00
parent 6361a23977
commit 0698e695bf
4 changed files with 161 additions and 21 deletions
+28
View File
@@ -0,0 +1,28 @@
import shelve
import random
WHITELIST = ['t0.vc', 'tanner', 'protospace', 'seed combinations', 'tcoins in circulation', 'pokemon trade', 'pokemon battle', 'unique in collection', '%) left.', 'telethon', 'datetime', ' +0000', 'print(', 'console.log', 'systemd', '-Iinclude', 'BOOT_IMAGE', '#endif', '/bin/bash', 'python3.', 'stdio.h']
db = shelve.open('data/t0txt')
keys = list(db.keys())
while True:
while True:
note_id = random.choice(keys)
note = db[note_id]
for good_word in WHITELIST:
if good_word in note.lower():
break
else: #for
break
print(note)
num_http = note.count('http')
num_line = note.count('\n')
print('num http:', num_http, 'lines:', num_line, 'ratio:', num_http / num_line if num_line else 'inf')
input()