Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 67ae9d7

Browse files
committed
Filter out ambiguous language names
1 parent b472c08 commit 67ae9d7

File tree

2 files changed

+7822
-8007
lines changed

2 files changed

+7822
-8007
lines changed

languagecodes/generate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ def update_data():
4343
iso3_map[part2t] = iso3
4444

4545
ref_name = normalize_code(row.pop("Ref_Name"))
46-
if ref_name is not None:
46+
if ref_name is not None and len(ref_name) > 3:
4747
iso3_map[ref_name] = iso3
4848

4949
# print(row)
5050

5151
code_file = os.path.join(path, "iso639.py")
5252
with io.open(code_file, "w", encoding="utf-8") as ofh:
53-
data = TEMPLATE % (list(iso3_ids), iso3_map, iso2_map)
53+
data = TEMPLATE % (list(sorted(iso3_ids)), iso3_map, iso2_map)
5454
ofh.write(data)
5555

5656
# doc = html.fromstring(res.content)

0 commit comments

Comments
 (0)