python-scraping
python-scraping copied to clipboard
Chapter 8: 2-countUncommon2Grams.py
First of all, I really enjoying working though all the examples in the book, however, on this specific chapter I am lost. You have a function isCommon but never use it in the program.
Also, the output that you have in the book does not match with what you have in this repo.
I am confused can you please advised? Thank you!
@fabienthiombiano I solved putting:
words = input[i:i+n]
# check if any of the words forming the n-gram is "common"
if isCommon(words):
continue
in the ngrams function, after the for loop:
...
for i in range(len(input)-n+1):
words = input[i:i+n]
# check if any of the words forming the n-gram is "common"
if isCommon(words):
continue
ngramTemp = " ".join(input[i:i+n])
...
I have the same problem, but you've done it well. It's great.