Improved extract method to work properly (sync)

This commit is contained in:
Kikimanox
2022-10-18 19:08:41 +02:00
parent b483e1643f
commit 673a83691b
9 changed files with 289 additions and 120 deletions
+13
View File
@@ -32,3 +32,16 @@ def multipla_conllus_to_one_from_file_ids(list_file_ids):
sent_cnt += 1
return ret
def multipla_conllus_to_one_from_conllus_arr(list_conllus):
sent_cnt = 1
ret = "# newpar id = 1\n"
for conllu in list_conllus:
conllu = conllu.replace('\r\n', '\n')
matches = sent_extractor.finditer(conllu)
for match in matches:
ret += f'# sent_id = 1.{sent_cnt}{match.group(1)}\n\n'
sent_cnt += 1
return ret