November 2015
Intermediate to advanced
304 pages
5h 23m
English
Chapter 7

1 #!/usr/bin/env python 2 import re, sys, operator 3 4 # Mileage may vary. If this crashes, make it lower 5 RECURSION_LIMIT = 9500 6 # We add a few more, because, contrary to the name, 7 # this doesn't just rule recursion: it rules the 8 # depth of the call stack 9 sys.setrecursionlimit(RECURSION_LIMIT+10) 10 11 def count(word_list, stopwords, wordfreqs): 12 # What to do with an empty list 13 if word_list == []: 14 return 15 # The inductive ...