jzohrab / lute

DEPRECATED: LUTE (Learning Using Texts) is a self-hosted web app for learning language through reading, based on Learning with Texts (LWT)
The Unlicense
119 stars 10 forks source link

Combine "parent term mapping" and "term import" #47

Closed jzohrab closed 1 year ago

jzohrab commented 1 year ago

Currently, "parent term mapping" is handled at "Import Parent Term mapping", and "term import" at "Import Terms". From a user's perspective, there's no real need for a difference, they're both just file imports. The parent term mapping takes a "parent [tab] child" mapping file, and the term import takes a CSV with several columns.

The Term Import could take a CSV with variable number of fields. Minimum required fields: language, term. Optional fields would be the rest. So, a parent mapping file could contain something like

language,term,parent
Spanish,gatos,gato

and the full import could have the whole thing.

jzohrab commented 1 year ago

The actually is a difference -- when mapping children to parents, the import file only creates and maps children if their parents are present.

So, if the import file for parent - child mapping was as follows:

dog    dogs

If "dogs" exists, but "dog" does not, only then is "dog" is created.

This is different behaviour from the "Import Term" feature, which just creates things, e.g.

dog    dogs

would create the dog term and the dogs term, if both were missing.

jzohrab commented 1 year ago

This ticket is incorrect and can't be done as-is. While the parent term mapping stuff may be confusing, perhaps that's a good thing, at least until I sort out how it might work better -- and that will only happen as I start to use it, or as other conscientious users get back to me with notes.