Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use a config file to specify relabeling options? #839

Open
aarppe opened this issue Jun 6, 2021 · 3 comments
Open

Use a config file to specify relabeling options? #839

aarppe opened this issue Jun 6, 2021 · 3 comments
Labels
Improvement Expansion or improvement of a current functionality that does already work and meets previous specs question Further information is requested

Comments

@aarppe
Copy link
Contributor

aarppe commented Jun 6, 2021

Use initial rows in crk.altlabel.tsv to specify what relabeling options are made available, and what they will be named.

  1. First row gives internal names for the various relabeling options.
  2. Second row (SELECTION-LABEL) gives the names that iDict will use for showing relabling options.
  3. Third row (SHOW-LABEL) will indicate whether the corresponding relabeling option will be shown (True) or not (False) in iDict.

E.g. for itwêwina, crk.altlabel.tsv contains the following first three rows, which already would support this modification:

ROW/COLUMN 1 2 3 4 5 6
1 FST TAG LINGUISTIC (SHORT) LINGUISTIC (LONG) ENGLISH NÊHIYAWÊWIN EMOJI
2 SELECTION-LABEL short linguistic labels long linguistic labels plain English labels nêhiyawêwin labels emojis
3 SHOW-LABEL True True True True False
@aarppe aarppe added the Improvement Expansion or improvement of a current functionality that does already work and meets previous specs label Jun 6, 2021
@eddieantonio
Copy link
Member

eddieantonio commented Jun 7, 2021

I will NOT implement this. I could be convinced to add configuration using a dedicated configuration file such as a .toml. However, I am not creating a mini-format in crk.altlabel.tsv.

@aarppe aarppe changed the title Use crk.altlabel.tsv to specify relabeling options Use crk.altlabel.tsv to specify relabeling options? Jun 8, 2021
@aarppe
Copy link
Contributor Author

aarppe commented Jun 8, 2021

Configurability is my primary goal, so added a question mark to the issue title. So, ok, using .toml, would something like the following work?:

[relabeling-1]
altlabelColumn = 1
morphodictLabel = "FST-style tags"
morphodictShow = false
morphodictOrder = 0

[relabeling-2]
altlabelColumn = 2
morphodictLabel = "short linguistic labels"
morphodictShow = true
morphodictOrder = 3

[relabeling-3]
altlabelColumn = 3
morphodictLabel = "long linguistic labels"
morphodictShow = true
morphodictOrder = 4

[relabeling-4]
altlabelColumn = 4
morphodictLabel = "plain English labels"
morphodictShow = true
morphodictOrder = 1

[relabeling-5]
altlabelColumn = 4
morphodictLabel = "nêhiyawêwin labels"
morphodictShow = true
morphodictOrder = 2

[relabeling-6]
altlabelColumn = 6
morphodictLabel = "emojis"
morphodictShow = false
morphodictOrder = 0

@andrewdotn
Copy link
Contributor

I don’t think we need this just yet, but when we do get to it, if I were to
apply the mallet of simplicity here, I would propose:

  • Labels come from the first row of the TSV file.
  • Relabelling order can come from the order of the columns in the TSV
    file too.
  • Let’s not have multiple names for the same thing. Instead of supporting
    two labels “Linguistic (short)” and “short linguistic labels”, pick one
    and stick to it. That is, Internal name = external name because Python
    strings and dict keys do support spaces.

This leaves only one really configurable thing, which is whether a column
should be shown in the UI or not. I propose adding this as a setting in
settings.py, where it could look like this:

# Which relabellings to show in the UI. These are opt-in so that people
# can add columns to the TSV file for testing without having them
# immediately show up on the web.
#
# It is a set, not a list, because the actual order comes from the .tsv
# file.
MORPHODICT_SHOWN_RELABELINGS = {
    "Linguistic (short)",
    "😎",
    …
}

Presumably admins could see all the relabelling options, with something to
indicate which are not yet public.

@nienna73 nienna73 changed the title Use crk.altlabel.tsv to specify relabeling options? Use a config file to specify relabeling options? May 11, 2022
@nienna73 nienna73 added the question Further information is requested label May 11, 2022
@fbanados fbanados moved this to To do in Third release Aug 2, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Improvement Expansion or improvement of a current functionality that does already work and meets previous specs question Further information is requested
Projects
Status: To do
Development

No branches or pull requests

4 participants