def test_txt_mix(self): print("orig_0.8_mix.txt的相似度 ") file = open("D:\\sim_0.8\\orig.txt", "r", encoding='UTF-8') orig_text = file.read() file.close() origin = calculation.Split_sentence(orig_text) file = open("D:\\sim_0.8\\orig_0.8_mix.txt", "r", encoding='UTF-8') orig_add_text = file.read() file.close() origin_add = calculation.Split_sentence(orig_add_text) sim = calculation.Calculation_Similiarity(origin, origin_add) sim = str("%.2f") % sim print(sim)
def test_txt_dis_15(self): print("orig_0.8_dis_15.txt的相似度 ") file = open("C:\\Users\\ids\\Desktop\\test\\orig.txt", "r", encoding='UTF-8') orig_text = file.read() file.close() origin = calculation.Split_sentence(orig_text) file = open("C:\\Users\\ids\\Desktop\\test\\orig_0.8_dis_15.txt", "r", encoding='UTF-8') orig_add_text = file.read() file.close() origin_add = calculation.Split_sentence(orig_add_text) sim = calculation.Calculation_Similiarity(origin, origin_add) sim = str("%.2f") % sim print(sim)