This commit is contained in:
hsafaei
2025-02-15 17:36:44 +03:30
parent 588ff54978
commit 43f46a17a3
+5 -5
View File
@@ -60,12 +60,12 @@ def create_nested_dictionary(lines, nested_dict={}):
def create_title_tree(title, tree): def create_title_tree(title, tree):
words = title.split() words = title.split()
current_level = tree dict_current_level = tree
for word in words: for word in words:
if word not in current_level: if word not in dict_current_level:
current_level[word] = {} dict_current_level[word] = {}
current_level = current_level[word] dict_current_level = dict_current_level[word]
current_level['='] = "ref" dict_current_level['='] = "ref"
def create_province_tree(input_file): def create_province_tree(input_file):
province_tree = {} province_tree = {}