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

Add Characters to LibreLingo python scripts #3405

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Skivling
Copy link

This is the preliminary work for #1143, implementing them in Python. Later, once @kantord is up to it in the web app rewrite they can be implemented there.

I have made some assumptions for what best to name the titles in Yaml and functions, which I am fine changing if there is a better option.

I have also added a property in Characters for their International Phonetic Alphabet (IPA) pronounciations, as I believe this would be useful to have below or above the characters for some learners, especially those who are very into linguistics and/or learning a conlang in a LibreLingo course.
The IPA value is not required in the schema so not including it won't cause any errors.

I hope unicode and such doesn't cause any bugs or errors such as a new character not displaying properly. 🤞

Currently Character()s in a skill look like this:

New Characters:
   
   - Character: ā
     Transliteration: aa
     IPA: /aː/
   
   - Character: Г
     Transliteration: H
     IPA: /ɦ/

And here they are in Python:

    # A long sound macron on an 'a' in Te Reo Māori
    >>> Character("ā", "aa", "/aː/")
    Character(character='ā', transliteration='aa', ipa_pronounciation='/aː/')

    # The Г character in Ukranian (which uses the Cyrillic script).
    >>> Character("Г", "H", "/ɦ/")
    Character(character='Г', transliteration='H', ipa_pronounciation='/ɦ/')

I have yet to finish the in-code documentation of the functions, then adding all this to the proper docs, hence this PR is a draft. I also haven't tested anything yet.

@Skivling
Copy link
Author

Skivling commented Oct 22, 2024

I have made the IPA field a list because it's quite common for a character to represent a few distinct but similar sounds. Same as the transliteration field.

Should the transliteration field be renamed as Transliterations (plural) to indicate this?

@Skivling Skivling marked this pull request as ready for review October 28, 2024 08:20
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

Successfully merging this pull request may close these issues.

1 participant