import Bigrams

class BigramModel:

    def __init__(self, label):
        pass #implement me!

    def readCorpus(self, file):
        pass # implement me!

    def getLikelihood(self, sequence):
        return 1.0 #pass implement me!




    def getBigramFrequency(self, bigram):
        return 1 #implement me!

    def getWordFrequency(self, word):
        return  sum([x[1] for x in self.counts.get(word,dict()).items()])

    def generateFollowUp(self, wordlist):
        return "the" # implement me!

    def compareSequences(self, words1, words2):
        return 0 # implement me

def test():
    Bigrams.crawlGutenbergCorpus()
    model = BigramModel('Gutenberg')
    model.readCorpus('bigcorpus')

    print(model.generateFollowUp(['little']))
    print(model.generateFollowUp(['My','dearest', 'little']))

    print(model.compareSequences(['the', 'little', 'boy','sleeps'], ['the', 'old', 'boy', 'snores']))

if __name__ == '__main__':
    test()


