# -*- coding: utf-8 -*-
"""
Created on Sun Sep 29 21:16:46 2019

@author: morri
"""

#%% load file
import time
start_time = time.time()
import importData
print('......loading file......')
queryList, docList, querys, docs = importData.importData()
print(time.time() - start_time)

#%% make dictionary
start_time = time.time()
import makeDictionary
print('......making the dictionary......')
dictionary,querysWords,docsWords = makeDictionary.createDictionary(querys,docs)
print(time.time() - start_time)

#%% calculate TF
start_time = time.time()
import calculateTF
print('......calculating TF......')
queryTF = calculateTF.getQueryTF(dictionary,querysWords)
docTF = calculateTF.getDocumentTF(dictionary,docsWords)
print(time.time() - start_time)

#%% calculate IDF
start_time = time.time()
import calculateIDF
print('......calculating IDF......')
IDF = calculateIDF.getIDF(queryTF, docTF, dictionary)
print(time.time() - start_time)

#%% calculate TF-IDF
start_time = time.time()
import calculateTFIDF
print('......calculating TF-IDF......')
queryTFIDF = calculateTFIDF.getQueryTFIDF(queryTF,IDF)
docTFIDF = calculateTFIDF.getDocTFIDF(docTF,IDF)
print(time.time() - start_time)

#%% calculate similarity
start_time = time.time()
import calculateCos
print('......calculating cosine similarity......')
querysSim = calculateCos.getSimilarity(docTFIDF, queryTFIDF)
print(time.time() - start_time)

#%% print out
start_time = time.time()
import printOutAnswer
print('......print out answer......')
printOutAnswer.printOutAnswer(queryList, docList, querysSim)
print(time.time() - start_time)

ca1b0226ecc9b1910e1539e0c467399ef24311d1
<mask token>

<mask token>
print('......loading file......')
<mask token>
print(time.time() - start_time)
<mask token>
print('......making the dictionary......')
<mask token>
print(time.time() - start_time)
<mask token>
print('......calculating TF......')
<mask token>
print(time.time() - start_time)
<mask token>
print('......calculating IDF......')
<mask token>
print(time.time() - start_time)
<mask token>
print('......calculating TF-IDF......')
<mask token>
print(time.time() - start_time)
<mask token>
print('......calculating cosine similarity......')
<mask token>
print(time.time() - start_time)
<mask token>
print('......print out answer......')
printOutAnswer.printOutAnswer(queryList, docList, querysSim)
print(time.time() - start_time)

<mask token>
start_time = time.time()
<mask token>
print('......loading file......')
queryList, docList, querys, docs = importData.importData()
print(time.time() - start_time)
start_time = time.time()
<mask token>
print('......making the dictionary......')
dictionary, querysWords, docsWords = makeDictionary.createDictionary(querys,
    docs)
print(time.time() - start_time)
start_time = time.time()
<mask token>
print('......calculating TF......')
queryTF = calculateTF.getQueryTF(dictionary, querysWords)
docTF = calculateTF.getDocumentTF(dictionary, docsWords)
print(time.time() - start_time)
start_time = time.time()
<mask token>
print('......calculating IDF......')
IDF = calculateIDF.getIDF(queryTF, docTF, dictionary)
print(time.time() - start_time)
start_time = time.time()
<mask token>
print('......calculating TF-IDF......')
queryTFIDF = calculateTFIDF.getQueryTFIDF(queryTF, IDF)
docTFIDF = calculateTFIDF.getDocTFIDF(docTF, IDF)
print(time.time() - start_time)
start_time = time.time()
<mask token>
print('......calculating cosine similarity......')
querysSim = calculateCos.getSimilarity(docTFIDF, queryTFIDF)
print(time.time() - start_time)
start_time = time.time()
<mask token>
print('......print out answer......')
printOutAnswer.printOutAnswer(queryList, docList, querysSim)
print(time.time() - start_time)

<mask token>
import time
start_time = time.time()
import importData
print('......loading file......')
queryList, docList, querys, docs = importData.importData()
print(time.time() - start_time)
start_time = time.time()
import makeDictionary
print('......making the dictionary......')
dictionary, querysWords, docsWords = makeDictionary.createDictionary(querys,
    docs)
print(time.time() - start_time)
start_time = time.time()
import calculateTF
print('......calculating TF......')
queryTF = calculateTF.getQueryTF(dictionary, querysWords)
docTF = calculateTF.getDocumentTF(dictionary, docsWords)
print(time.time() - start_time)
start_time = time.time()
import calculateIDF
print('......calculating IDF......')
IDF = calculateIDF.getIDF(queryTF, docTF, dictionary)
print(time.time() - start_time)
start_time = time.time()
import calculateTFIDF
print('......calculating TF-IDF......')
queryTFIDF = calculateTFIDF.getQueryTFIDF(queryTF, IDF)
docTFIDF = calculateTFIDF.getDocTFIDF(docTF, IDF)
print(time.time() - start_time)
start_time = time.time()
import calculateCos
print('......calculating cosine similarity......')
querysSim = calculateCos.getSimilarity(docTFIDF, queryTFIDF)
print(time.time() - start_time)
start_time = time.time()
import printOutAnswer
print('......print out answer......')
printOutAnswer.printOutAnswer(queryList, docList, querysSim)
print(time.time() - start_time)

# -*- coding: utf-8 -*-
"""
Created on Sun Sep 29 21:16:46 2019

@author: morri
"""

#%% load file
import time
start_time = time.time()
import importData
print('......loading file......')
queryList, docList, querys, docs = importData.importData()
print(time.time() - start_time)

#%% make dictionary
start_time = time.time()
import makeDictionary
print('......making the dictionary......')
dictionary,querysWords,docsWords = makeDictionary.createDictionary(querys,docs)
print(time.time() - start_time)

#%% calculate TF
start_time = time.time()
import calculateTF
print('......calculating TF......')
queryTF = calculateTF.getQueryTF(dictionary,querysWords)
docTF = calculateTF.getDocumentTF(dictionary,docsWords)
print(time.time() - start_time)

#%% calculate IDF
start_time = time.time()
import calculateIDF
print('......calculating IDF......')
IDF = calculateIDF.getIDF(queryTF, docTF, dictionary)
print(time.time() - start_time)

#%% calculate TF-IDF
start_time = time.time()
import calculateTFIDF
print('......calculating TF-IDF......')
queryTFIDF = calculateTFIDF.getQueryTFIDF(queryTF,IDF)
docTFIDF = calculateTFIDF.getDocTFIDF(docTF,IDF)
print(time.time() - start_time)

#%% calculate similarity
start_time = time.time()
import calculateCos
print('......calculating cosine similarity......')
querysSim = calculateCos.getSimilarity(docTFIDF, queryTFIDF)
print(time.time() - start_time)

#%% print out
start_time = time.time()
import printOutAnswer
print('......print out answer......')
printOutAnswer.printOutAnswer(queryList, docList, querysSim)
print(time.time() - start_time)
