def bagOfWords_GaussianNB(txtFile):
    total_words = 0
    reviewFile = txtFile
    with open(reviewFile, 'r', encoding='utf8') as file:
        txt = file.read().replace('\n', '')
    reviewList = txt.split('<br /><br />')
    numReviews = len(reviewList)
    for review in reviewList:
        review = re.sub('[^\\w\\s]', '', review)
    vocabTokens = createVocabTokens(reviewList)
    vocabDict = dict.fromkeys(vocabTokens, 0)
    for i in range(len(reviewList)):
        words = extractCleanWords(reviewList[i])
        for word in words:
            vocabDict[word] += 1
    sparseMatrix = []
    for i in range(len(reviewList)):
        words = extractCleanWords(reviewList[i])
        bagList = {}
        for word in words:
            if (word in bagList):
                bagList[word] += 1
            else:
                bagList[word] = 1
        sparseMatrix.append(bagList)
    return (sparseMatrix, vocabDict, numReviews)
def bagOfWords_GaussianNB(txtFile):
    total_words = 0
    reviewFile = txtFile
    with open(reviewFile, 'r', encoding='utf8') as file:
        txt = file.read().replace('\n', )
    reviewList = txt.split('<br /><br />')
    numReviews = len(reviewList)
    for review in reviewList:
        review = re.sub('[^\\w\\s]', , review)
    vocabTokens = createVocabTokens(reviewList)
    vocabDict = dict.fromkeys(vocabTokens, 0)
    for i in range(len(reviewList)):
        words = extractCleanWords(reviewList[i])
        for word in words:
            vocabDict[word] += 1
    sparseMatrix = []
    for i in range(len(reviewList)):
        words = extractCleanWords(reviewList[i])
        bagList = {}
        for word in words:
            if (word in bagList):
                bagList[word] += 1
            else:
                bagList[word] = 1
        sparseMatrix.append(bagList)
    return (sparseMatrix, vocabDict, numReviews)