-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
@bt2901 suggests to add Proto-Slavic flavorization:
VOWELS = 'aeiouyęěǫъь'
CONSONANTS = 'bcdgjklmnprstvxzčďľňřśšťž'
def classify_yers(word):
# See: https://en.wikipedia.org/wiki/Havlík%27s_law
vowels_pos = [i for i, s in enumerate(word) if s in VOWELS]
is_weak = True
classified_vowels = []
for i in reversed(vowels_pos):
vowel = word[i]
if vowel not in ["ь", "ъ"]:
is_weak = True
else:
vowel = vowel if is_weak else vowel.upper()
is_weak = not is_weak
classified_vowels.append(vowel)
word_as_arr = list(word)
for i, v in zip(vowels_pos, reversed(classified_vowels)):
word_as_arr[i] = v
return "".join(word_as_arr)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels