// Receive data from the server and shut down
data = b""
while True:
packet = sock.recv(4096)
if not packet:
break
data += packet
received = pickle.loads(data)
all_phrases.extend(received)
print("vocab len = " + str(len(all_phrases)))
// print("Received: {}".format(received))
After Change
all_phrases_dict[p] = p
all_cut_phrases_dict[p] = p
else:
all_phrases_dict[p] = p[:max_phrase_length] + "..."
all_cut_phrases_dict[p[:max_phrase_length] + "..."] = p
print("done. vocab count = " + str(len(all_phrases)))
// pp = pprint.PrettyPrinter()