Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def wordCounts(self, revision=-1):
- pageCrap = NOTAGRE.sub("", self.getHTML(revision))
- ret = collections.defaultdict(int)
- for word in pageCrap:
- per = set()
- for i in range(len(word)):
- for j in range(i+1, len(word)+1):
- per |= {word[i:j]}
- for i in per:
- ret[i] += 1
- return dict(ret)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement