|
@@ -468,15 +468,17 @@ def adjustSub_by_text_similarity(gts_in,gens_raw):
|
|
duplicated_list = []
|
|
duplicated_list = []
|
|
for idx in range(len(gens)):
|
|
for idx in range(len(gens)):
|
|
match_text = difflib.get_close_matches(gens[idx], alls, cutoff=0.1)
|
|
match_text = difflib.get_close_matches(gens[idx], alls, cutoff=0.1)
|
|
-
|
|
|
|
- if match_text[0] in duplicated_list:
|
|
|
|
- for mt in match_text:
|
|
|
|
- if mt == adjusted[idx-1]: #or mt not in duplicated_list:
|
|
|
|
- adjusted[idx] = mt
|
|
|
|
- break
|
|
|
|
- else:
|
|
|
|
- adjusted[idx] = match_text[0]
|
|
|
|
- duplicated_list.append(match_text[0])
|
|
|
|
|
|
+ if match_text is not None:
|
|
|
|
+ if match_text[0] in duplicated_list:
|
|
|
|
+ for mt in match_text:
|
|
|
|
+ if mt == adjusted[idx-1]: #or mt not in duplicated_list:
|
|
|
|
+ adjusted[idx] = mt
|
|
|
|
+ break
|
|
|
|
+ else:
|
|
|
|
+ adjusted[idx] = match_text[0]
|
|
|
|
+ duplicated_list.append(match_text[0])
|
|
|
|
+ else :
|
|
|
|
+ adjusted[idx] = gens[idx]
|
|
|
|
|
|
if None == adjusted[idx]:
|
|
if None == adjusted[idx]:
|
|
adjusted[idx] = gens[idx]
|
|
adjusted[idx] = gens[idx]
|