-
Notifications
You must be signed in to change notification settings - Fork 3
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
Transliterate Greek according to ELOT 743. Untested #4
base: main
Are you sure you want to change the base?
Conversation
Oh my god. Right after I did the pull request, I figured out why it doesn't work; I replace the thing just fine, but I never actually commit any of my changes to a variable... EDIT: Nope, that's not it. The if statements after the for loops appear to not be called at all |
Works fine. I had three mistakes I fixed:
More testing is required, but I think it works fine. |
… PSari, but ΨΑΡΙ is still PSARI)
Tested it a bit, seems to work fine. Possible point of failure is more than one word of input with two starting "Μπ"s (Μπαμπας Μπαμπουλας) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work. I would expect a few tests before merging. I could write the docs for that!
… PSari, but ΨΑΡΙ is still PSARI)
…t arose from that. Made lists into dictionary and simplified the "dumb" transliteration code thanks to that. Used remove_accentuation to allow for input of accented sentences. Added proper transliteration for "ου" in all cases accented or unaccented. To facilitate that, changed remove_accentuation.py to have an optional input that skips the diairesis step
…dded features as required for greek_elot_transliteration.py In greek_elot_transliteration.py: Fixed bugs revolving around ου, made some mild readability improvements In README.md: Minor grammar changes, documented changes to remove_accentuation.py as well as usage of greek_elot_transliteration.py In test_tests.py: Added rudimentary tests. Not sure if they're properly implemented.
# Conflicts: # README.md
I think I did the tests? I wrote them, at the very least. I've never written tests before hahah. Would appreciate some feedback. Speaking of docs, I wrote some! My branch conflicted with yours, and I had no idea how to properly merge 'em so I improvised a little. Def not a good way of doing things, but ah well. I'm thinking it's in a state where it could be merged, but I'd appreciate your feedback on all the changes I made, and if there's any way I can improve it. |
Sorry for the delay but couldn't find time to review it. I'll test it and leave a comment at the code section and a suggestion! But great work altogether! |
# Accent based digraphs | ||
# el_low_acc_digraphs = [ | ||
# "άυ", | ||
# "αϋ", | ||
# | ||
# "έυ", | ||
# "εϋ", | ||
# | ||
# "ήυ", | ||
# "ηϋ" | ||
# | ||
# ] | ||
# el_mix_acc_digraphs = [ | ||
# "Άυ", | ||
# "Αϋ", | ||
# | ||
# "Έυ", | ||
# "Εϋ", | ||
# | ||
# "Ήυ", | ||
# "Ηϋ" | ||
# ] | ||
# el_cap_acc_digraphs = [ | ||
# "ΆΥ", | ||
# "ΑΫ", | ||
# | ||
# "ΈΥ", | ||
# "ΕΫ", | ||
# | ||
# "ΉΥ", | ||
# "ΗΫ" | ||
# ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we delete all commented code since it's not used!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... Reminder to myself not to use GitHub on the phone again. It had me fooled, thinking I only had one notification haha
Sure! I'll keep it saved in a file or something on my own computer for future use.
@@ -1,4 +1,4 @@ | |||
def remove_accentuation(string: str): | |||
def remove_accentuation(string: str, modifier=0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be modifier=True not 0. I also would like to rename modifier to something like keep_dieresis=True or something like that.
if modifier == 0: | ||
if c in dieresis.keys() and prev_char in ("ά", "ό", "έ"): | ||
char = dieresis[c] | ||
if modifier == 1: # Remove dieresis | ||
if c in dieresis_reverse.keys(): | ||
char = dieresis_reverse[c] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if modifier == 0 can become if modifier:
which equals to if modifier == True
,
and if modifier == 1 can become if not modifier:
which equals to if modifier == False
.
"φ", | ||
"χ", | ||
"ψ" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would preffer all list pairs tyo be converted into dicts but it's more of a readability enchancement!
No problem at all, and thanks! Take your time, there's no rush! |
Hey! Is there any progress? |
Hey! Sorry for not being active. I've been swamped with schoolwork, but once the easter break starts in a few weeks I plan to pick the project back up. Thanks for your understanding! |
This is as far as I'm gonna go today, bit of a noob in python and I hope it doesn't show too much. Doesn't work properly, and I have no idea why, but I figure I'm pretty close? And at least it doesn't throw an error! Probably... It should be working. Anyway. Heavily WIP, consider merging after testing.
Current limitations
Can't do accents according to the standard, expects a de-accented input.
Doesn't work.Possible redundancy in the ifs. Suggestions to improve welcome!It does not sanity-check inputs or outputs, and has no testing it can run to make sure future edits don't break something.