Skip to content

Commit

Permalink
Fix to sub language split operation and remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Nov 28, 2024
1 parent bef04a1 commit ce74f0f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
2 changes: 1 addition & 1 deletion src/scribe_data/cli/total.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def get_datatype_list(language):

# Adjust language_key for sub-languages using the format_sublanguage_name function.
formatted_language = format_sublanguage_name(language_key, language_metadata)
language_key = formatted_language.split("/")[
language_key = formatted_language.split(" ")[
0
].lower() # use the main language part if formatted

Expand Down
18 changes: 0 additions & 18 deletions src/scribe_data/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,24 +570,6 @@ def map_cases(wikidata_case: str) -> str:
return case_map.get(case, "")


def order_annotations(annotation: str) -> str:
"""
Standardizes the annotations that are provided to users where more than one is applicable.
Parameters
----------
annotation : str
The annotation to be returned to the user in the command bar.
"""
if "/" not in annotation:
return annotation

# Remove repeat annotations, if present.
annotation_split = sorted(list(set(filter(None, annotation.split("/")))))

return "/".join(annotation_split)


def format_sublanguage_name(lang, language_metadata=_languages):
"""
Formats the name of a sub-language by appending its main language
Expand Down

0 comments on commit ce74f0f

Please sign in to comment.