Update fix langlinks.py
Browse files- fix langlinks.py +5 -5
fix langlinks.py
CHANGED
@@ -89,9 +89,10 @@ for tab in tqdm.tqdm(data):
|
|
89 |
key3 = re.sub(rf'\b{re.escape(en_country)}\b', 'country', key2)
|
90 |
value3 = re.sub(rf'\b{re.escape(ar_country)}\b', 'country', value2)
|
91 |
# ---
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
95 |
# ----
|
96 |
"""
|
97 |
for en_c, ar_c in countries.items():
|
@@ -113,7 +114,6 @@ datasets_list = {
|
|
113 |
"cats_2000" : "categories_en2ar-cats_2000",
|
114 |
}
|
115 |
|
116 |
-
|
117 |
# for x, data_list in data_lists.items():
|
118 |
for x in to_work:
|
119 |
data_list = data_lists.get(x)
|
@@ -127,7 +127,7 @@ for x in to_work:
|
|
127 |
print("______________")
|
128 |
print(f"file: {x} uploaded successfully!")
|
129 |
print(f"len of {x} : {len(data_list)}.")
|
130 |
-
continue
|
131 |
upload_file(
|
132 |
path_or_fileobj=f"{x}.json", # اسم الملف الذي تم حفظه
|
133 |
path_in_repo=f"{x}.json", # المسار داخل المستودع
|
|
|
89 |
key3 = re.sub(rf'\b{re.escape(en_country)}\b', 'country', key2)
|
90 |
value3 = re.sub(rf'\b{re.escape(ar_country)}\b', 'country', value2)
|
91 |
# ---
|
92 |
+
if key3 not in data_lists["cats_2000_contry"]:
|
93 |
+
print(f"{key3} → {value3}")
|
94 |
+
# ---
|
95 |
+
data_lists["cats_2000_contry"][key3] = value3
|
96 |
# ----
|
97 |
"""
|
98 |
for en_c, ar_c in countries.items():
|
|
|
114 |
"cats_2000" : "categories_en2ar-cats_2000",
|
115 |
}
|
116 |
|
|
|
117 |
# for x, data_list in data_lists.items():
|
118 |
for x in to_work:
|
119 |
data_list = data_lists.get(x)
|
|
|
127 |
print("______________")
|
128 |
print(f"file: {x} uploaded successfully!")
|
129 |
print(f"len of {x} : {len(data_list)}.")
|
130 |
+
#continue
|
131 |
upload_file(
|
132 |
path_or_fileobj=f"{x}.json", # اسم الملف الذي تم حفظه
|
133 |
path_in_repo=f"{x}.json", # المسار داخل المستودع
|