def doc_classify(self): tmp = self.table_widget.control1_wid.combo_box.currentText() self.statusBar().showMessage('Classifying files') if tmp == "docx": SimilarityRatio(self.files_path.docx,"docx") elif tmp == "pptx": SimilarityRatio(self.files_path.pptx,"pptx") elif tmp == "xlsx": SimilarityRatio(self.files_path.xlsx,"xlsx")
def doc_classify2(self): tmp = self.table_widget.control1_wid.combo_box.currentText() self.statusBar().showMessage('Classifying new file') f1 = self.open_file(type=tmp) if not f1: self.statusBar().showMessage('Action Cancelled') else: if tmp == "docx": SimilarityRatio([f1],"docx", method="inference") elif tmp == "pptx": SimilarityRatio([f1],"pptx", method="inference") elif tmp == "xlsx": SimilarityRatio([f1],"xlsx", method="inference")
def doc_similarity(self): tmp = self.table_widget.control1_wid.combo_box.currentText() self.statusBar().showMessage('Calculating Similarity of 2 files') f1 = self.open_file(type=tmp) f2 = self.open_file(type=tmp) if not f1 or not f2: self.statusBar().showMessage('Action Cancelled') else: SimilarityRatio([f1,f2],tmp,method="fuzzywuzzy")
elif op == "docx_compare": startTime = time.time() CompareFiles(files_path.docx, "docx") elif op == "xlsx_compare": startTime = time.time() CompareFiles(files_path.xlsx, "xlsx") elif op == "pptx_compare": startTime = time.time() CompareFiles(files_path.pptx, "pptx") elif op == "docx_similarity": startTime = time.time() SimilarityRatio(files_path.docx, "docx", method="None") elif op == "xlsx_similarity": startTime = time.time() SimilarityRatio(files_path.xlsx, "xlsx", method="fuzzywuzzy") elif op == "pptx_similarity": startTime = time.time() SimilarityRatio(files_path.pptx, "pptx", method="fuzzywuzzy") elif op == "txt_class_txt": startTime = time.time() for term in search_terms: c(files_path.docx, search=term) c(files_path.pptx, search=term) c(files_path.xlsx, search=term)