letuananh / bela

👸 BELA - A pathway for creating and analysing multi-lingual transcripts using BELA convention and ELAN software
MIT License
3 stars 2 forks source link

Flag baby `:v:` language tags as errors if they appear on adult language tiers #2

Open vicchuayh opened 2 years ago

vicchuayh commented 2 years ago

Currently, if baby language tags (:v:vocalizations,:v:laughter, :v:airstream, :v:crying) appear on adult language tiers, it is not flagged as an error.

Proposed implementation in Python:

def _find_baby_lang_adult(belan):
    for p in belan.persons:
        if 'Baby' not in p.name:
            if 'Sibling' not in p.name:
                for u in p.utterances:
                    for c in u.chunks:
                        if c.language.startswith(':v:'):
                            errors.append(f"{belan.path} : {c} tagged as {c.language} found on {p.name} (Language) tier (should be reserved for Baby (Language) only)")
letuananh commented 2 years ago

I see that you want to reserve :v:laughter for babies only, how about when a parent laugh?

vicchuayh commented 1 year ago

According to BELA-con, :v:laughter should appear on Baby (Language) tiers but not on Baby (Utterance) tiers. It's the opposite for adult tiers (i.e., can appear on Adult (Utterance) but not Adult (Language)).