def main():
    print os.getcwd()
    basepath = os.path.dirname(__file__)
    filepath = os.path.abspath(os.path.join(basepath, "..", "..", "..", "..", "bluesGrammar.txt"))
    parser = GrammarManualParser(filepath)
    grammarDict = parser.parseIntoDictionary()
    generator = ProbabilisticSentenceGenerator(grammarDict)
    print 'generated:', generator.generate('Q4')
def main():
    print os.getcwd()
    basepath = os.path.dirname(__file__)
    filepath = os.path.abspath(os.path.join(basepath, "..", "..", "..", "..", "bluesGrammar.txt"))
    parser = GrammarManualParser(filepath)
    grammarDict = parser.parseIntoDictionary()
    
    grammarWeightingNormaliser = GrammarWeightingNormaliser(grammarDict)
    newGrammarDict = grammarWeightingNormaliser.normaliseProbabilities()
    print 'normalised grammar:', newGrammarDict