import urllib.request
import re

class Sitegram:
    def __init__(self, url):
        self.hist = {}
        text = urllib.request.urlopen(url).read().decode('UTF-8')
        # Use re.findall() to get the words from text
        # Then count them up in self.hist

    def countOf(self, word):
        pass
        # Check for the word; if present, return count;
        # if absent, return zero
        

class SearchData:
    def __init__(self):
        self.sites = {}

    def addSite(self, url):
        self.sites[url] = Sitegram(url)

    def rankedPages(self, term):
        pass
        # Your code here
