Modify checker script for SS3
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Anthony Wang 2024-03-28 11:41:21 -05:00
parent e5a45460f9
commit d84d852ce6
Signed by: a
SSH key fingerprint: SHA256:B5ADfMCqd2M7d/jtXDoihAV/yfXOAbWWri9+GdCN4hQ

View file

@ -1,5 +1,6 @@
# Example usage:
# python static/src/short-story.py (curl -s https://raw.githubusercontent.com/awestover/skyspace/master/posts/misc/src/02-25-24.md | tail -n +10 | psub) (tail -n +13 content/posts/short-story-2.md | psub)
# python static/src/short-story.py (tail -n +13 content/posts/short-story-2.md | psub) (tail -n +13 content/posts/guest-post-short-story-3.md | psub)
from collections import Counter
from re import sub
@ -8,7 +9,7 @@ from sys import argv
def cnt(filename):
c = Counter()
with open(filename) as f:
for w in f.read().split():
for w in f.read().replace('--', ' ').split():
c[sub(r'[^a-zA-Z]', '', w).lower()] += 1
return c