mirror of
http://nostr-git-proxy.forgejo.svc.cluster.local/git/45387ca441053e230b2126802005eb03767ab59d84555e8bac86b6e7def14e27/bestdadjokes
synced 2026-11-03 07:26:59 +00:00
10 lines
330 B
Python
10 lines
330 B
Python
import json, collections, re
|
|
with open("content/jokes.json") as f:
|
|
data = json.load(f)
|
|
jokes = data["jokes"]
|
|
words = collections.Counter()
|
|
for j in jokes:
|
|
for word in re.findall(r"\b\w+\b", j["setup"].lower() + " " + j["punch"].lower()):
|
|
if len(word) > 4:
|
|
words[word] += 1
|
|
print(words.most_common(50))
|