From 96d03b5e477f6c7c01aecc4435a036a46338bcc0 Mon Sep 17 00:00:00 2001 From: Luka Date: Thu, 27 Sep 2018 14:47:04 +0200 Subject: [PATCH] Sloleks accentuation fix --- sloleks_accentuation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sloleks_accentuation.py b/sloleks_accentuation.py index 223e8df..5e688fd 100755 --- a/sloleks_accentuation.py +++ b/sloleks_accentuation.py @@ -84,7 +84,7 @@ done_lexical_entries = 33522 import gc with open("data/new_sloleks/new_sloleks.xml", "ab") as myfile: - myfile2 = open('data/new_sloleks/p' + str(iter_index) + '.xml', 'ab') + # myfile2 = open('data/new_sloleks/p' + str(iter_index) + '.xml', 'ab') for event, element in etree.iterparse('data/Sloleks_v1.2.xml', tag="LexicalEntry", encoding="UTF-8", remove_blank_text=True): # LOAD NEW WORDS AND ACCENTUATE THEM # print("HERE") @@ -100,8 +100,8 @@ with open("data/new_sloleks/new_sloleks.xml", "ab") as myfile: continue if word_glob_num >= word_limit: - myfile2.close() - myfile2 = open('data/new_sloleks/p' + str(iter_index) + '.xml', 'ab') + # myfile2.close() + # myfile2 = open('data/new_sloleks/p' + str(iter_index) + '.xml', 'ab') iter_index += 1 print("Words proccesed: " + str(word_glob_num)) @@ -155,7 +155,7 @@ with open("data/new_sloleks/new_sloleks.xml", "ab") as myfile: word_index += 1 # print(etree.tostring(element, encoding="UTF-8")) - myfile2.write(etree.tostring(element, encoding="UTF-8", pretty_print=True)) + # myfile2.write(etree.tostring(element, encoding="UTF-8", pretty_print=True)) myfile.write(etree.tostring(element, encoding="UTF-8", pretty_print=True)) element.clear() lexical_entries_save_number += 1