-
-
Save technillogue/d296da65827caeb5b357 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#mount a Gutenberg CD | |
mount -t iso9660 PG2003-08.ISO iso -o loop | |
# flatten the hierarchy of a Gutenberg CD | |
cp $(find iso -name "*.txt") lt/corpus | |
# strip the corpus | |
for i in $(ls corpus); do < corpus/$i ./strip.py > words/$i; done | |
# count some words | |
for i in $(ls words); do < words/$i ./wordcount.py > wc/$i; done | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# parse the master list of books in a Gutenberg CD | |
with open("master_list.csv") as f: | |
meta = [[((title + ": " + subtitle) if subtitle else title), (ln, fn), txt] for title,subtitle,fn,ln,txt,html,catmo,catyear,lang in csv.reader(f) if lang is '' and txt is not '']d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment