diff options
author | Anthony Wang | 2024-03-28 11:41:21 -0500 |
---|---|---|
committer | Anthony Wang | 2024-03-28 11:41:21 -0500 |
commit | d84d852ce62b1f6b14f4fd278e3ac9c96872803d (patch) | |
tree | 28e1ecdf0665627f7c7c2754c63948d407f92d67 /static | |
parent | e5a45460f940984c43e2c028f2a0bbe307098ca1 (diff) |
Modify checker script for SS3
Diffstat (limited to 'static')
-rw-r--r-- | static/src/short-story.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/static/src/short-story.py b/static/src/short-story.py index 544edef..521f8c4 100644 --- a/static/src/short-story.py +++ b/static/src/short-story.py @@ -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 |