-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Description
- Are
tags/raw_tagsexpected to be sorted / unique, and if so, at which point of the program: only at the end, during the whole program etc.? - For non-en editions, are
raw_tagsexpected to be removed once they are translated intotags?
While the docs state that:
we move tags that could be converted to tags to "tags" or "topics" field.
I understand this as expected to be removed once they are translated but the snippet seems to be deleting every raw_tag. I would expect something like:
def translate_raw_tags(data: WordEntry):
raw_tags = []
for raw_tag in data.raw_tags:
if raw_tag in TAGS:
data.tags.append(TAGS[raw_tag])
elif raw_tag in TOPICS:
data.topics.append(TOPICS[raw_tag])
else:
raw_tags.append(raw_tag)
data.raw_tags = raw_tagsAlso, somewhat related, the type hint of this generic translate_raw_tags seems to be violated in a couple languages that I've checked, where it is called with a Form list, Sound etc.
sound = Sound(ipa=ipa, raw_tags=raw_tags)
translate_raw_tags(sound)I perfectly understand why this happens but it remains a bit confusing on first sight.
Metadata
Metadata
Assignees
Labels
No labels