Skip to content

Commit

Permalink
Merge branch 'hotfix/4.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
lukavdplas committed Jun 28, 2023
2 parents 56f9d39 + 890236d commit 2e55899
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/addcorpus/corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import csv
import sys
from datetime import datetime
from langcodes import Language
from langcodes import Language, standardize_tag
from os.path import isdir
import logging
logger = logging.getLogger('indexing')
Expand Down Expand Up @@ -271,9 +271,10 @@ def serialize(self):
field_list.append(field.serialize())
corpus_dict[ca[0]] = field_list
elif ca[0] == 'languages':
format = lambda tag: Language.make(standardize_tag(tag)).display_name() if tag else 'Unknown'
corpus_dict[ca[0]] = [
Language.make(language).display_name()
for language in ca[1]
format(tag)
for tag in ca[1]
]
elif ca[0] == 'category':
corpus_dict[ca[0]] = self._format_option(ca[1], CATEGORIES)
Expand Down

0 comments on commit 2e55899

Please sign in to comment.