CentreForDigitalHumanities / CentreForDigitalHumanities/Textcavator

Improve documentation of `addcorpus.models.Field.language`

Open
#1,522 2 comments 0 reactions 0 assignees View on GitHub
backend code quality
Dominant language
Python
Stars
12
Forks
3
Avg merge
3d 3m
Merged PRs (30d)
9

Description

The [`language` field of the `Field` model](https://github.com/UUDigitalHumanitieslab/I-analyzer/blob/fb1d88c068bc7e8a74372baa0c6951c1eba90c14/backend/addcorpus/models.py#L354) looks strange to me:
It has a `CharField` with `blank=True, null=False`. So then we should set a default, I believe? NB `null=False` is not necessary to state explicitly (and it's not advised to set this to `True` on `CharField`s anyway). `validate_field_language` seems to assume that fields which don't have an explicit language tag set would have to have "dynamic" set. I'm not sure I agree with enforcing that every field, or for "dynamic", the corpus, has a valid language tag, in some corpora we simply don't have that kind of metadata. A docstring in `validate_field_language` about the meaning of the "dynamic" setting may also not be misplaced.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with backend/addcorpus/models.py, especially Field.language and validate_field_language. Review the current field defaults and validation behavior against the questions about missing language metadata and the “dynamic” setting. Done requires an agreed decision on the intended behavior and corresponding documentation, with validation expectations clarified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.