git @ Cat's Eye Technologies Dissociated-Parse / 05d17a2
Add cleanup script. Chris Pressey 1 year, 9 months ago
2 changed file(s) with 23 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
4343 ./05_build.py
4444 ./06_traverse.py 'Give your Novel a Title Here' >out.md
4545 wc -w out.md
46 t-rext out.md > 'Your Novel.md'
46 t-rext out.md > out2.md
47 python3 cleanup.py out2.md > 'Your Novel.md'
4748 pandoc --from=markdown --to=html5 <'Your Novel.md' >'Your Novel.html'
4849 firefox 'Your Novel.html'
0 import string
1 import sys
2
3
4 def main():
5 for line in sys.stdin:
6 line = line.replace('..', '.')
7 line = line.replace('.,', ',')
8 line = line.replace(" 's", "'s")
9 for letter in string.ascii_lowercase:
10 line = line.replace(". " + letter, ". " + letter.upper())
11 if line.startswith(', '):
12 line = 'Lo' + line
13 if 'gloom' in line:
14 line = line.rstrip() + ' _' + line.rstrip() + '_\n'
15 sys.stdout.write(line)
16
17
18 if __name__ == '__main__':
19 # MAKE MINE A 99
20 main()