Skip to content

check for None when splitting on Sentence_Number.Phrase_Number #4

@Glottotopia

Description

@Glottotopia

In line 406 of flex2csv.py, you split an ID into sentence number (before period) and phrase number (after period). This fails if the sentence number had not been retrieved.

Be tolerant with records without sentence numbers. Users might still want to convert them.

As a quick fix, I used

    if "." in rec.get("Sentence_Number", "noperiod"):
        rec["Sentence_Number"], rec["Phrase_Number"] = rec["Sentence_Number"].split(".")
    return rec

but try/catch or checking for "Sentence_Number" in rec should also work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions