Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

check for None when splitting on Sentence_Number.Phrase_Number #4

Open
Glottotopia opened this issue Apr 15, 2024 · 0 comments
Open

Comments

@Glottotopia
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant