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

Deal with 'o', double 'u' #3

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

Deal with 'o', double 'u' #3

wants to merge 2 commits into from

Conversation

AnastasiaKuliak
Copy link
Collaborator

Дублюю пояснення тут:

щодо голосних мій головний concern зараз в тому, що наголошені і ненаголошені “o” позначаються однаково - знаком [ɔ]:

при́пхнутого -> ˈprɪpxnʊtɔɦɔ
поверхово́див -> pɔu̯erxɔˈu̯ɔdeu̯
електро́нні -> eleˈktrɔnʲːi
а́еродром -> ˈɑerɔdrɔm

а в вікіпедії взагалі написано що ɔ це знак наголошеного “о”, що типу взагалі протилежне тому що в коді пишуть в коментарях, тому я думаю що в вікі помилка просто на цій сторінці https://uk.wikipedia.org/wiki/%D0%94%D0%BE%D0%B2%D1%96%D0%B4%D0%BA%D0%B0:%D0%9C%D0%A4%D0%90/%D0%A3%D0%BA%D1%80%D0%B0%D1%97%D0%BD%D1%81%D1%8C%D0%BA%D0%B0

тому що якщо зайти на сторінку звука ɔ, то там написано “Один з основних звуків української мови. Має наголошений алофон — звук [o̞] (поїзд)” https://uk.wikipedia.org/wiki/%D0%9E%D0%B3%D1%83%D0%B1%D0%BB%D0%B5%D0%BD%D0%B8%D0%B9_%D0%B3%D0%BE%D0%BB%D0%BE%D1%81%D0%BD%D0%B8%D0%B9_%D0%B7%D0%B0%D0%B4%D0%BD%D1%8C%D0%BE%D0%B3%D0%BE_%D1%80%D1%8F%D0%B4%D1%83_%D0%BD%D0%B8%D0%B7%D1%8C%D0%BA%D0%BE%D1%81%D0%B5%D1%80%D0%B5%D0%B4%D0%BD%D1%8C%D0%BE%D0%B3%D0%BE_%D0%BF%D1%96%D0%B4%D0%BD%D1%8F%D1%82%D1%82%D1%8F
тобто цей самий звук - це позначка ненаголошеного “o”

також вирішила виправити те як транскрибується 'вакуум' :)

@AnastasiaKuliak AnastasiaKuliak self-assigned this May 12, 2022
@AnastasiaKuliak AnastasiaKuliak requested a review from danmysak May 12, 2022 13:11
Copy link
Collaborator

@danmysak danmysak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мені здавалося, задум Дмитра був залишити — як один із варіантів — транслітерацію вікшинарі без будь-яких змін. Принаймні це зараз записано в коментарі зверху файла.

@dchaplinsky
Copy link
Contributor

dchaplinsky commented May 12, 2022 via email

@AnastasiaKuliak
Copy link
Collaborator Author

AnastasiaKuliak commented May 12, 2022

@danmysak @dchaplinsky я тут не вношу зміни до транслітерації, а виправляю помилку цієї ж транслітерації, яка тут задумана 🤔 просто навіть за транслітерацією вікшинарі 'o' не може весь час транскрибуватись як ненаголошена 💁
а попередня версія коду буде жити завжди ж у попередній версії проекту 🧐 what's the deal?

# unstressed /u/ has an allophone [ʊ]
phonetic = re.sub(r"([^ˈ])u", r"\1ʊ", phonetic)
phonetic = re.sub(r"^u", r"ʊ", phonetic)
# unstressed /ɔ/ has a stressed allophone [o]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I believe the comment should say stressed /ɔ/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah, you're right

@@ -153,7 +155,7 @@ def ipa(text: str, check_accent: bool) -> str:
# including stress mark for single-syllable words if check_accent is set to true
number_of_vowels = len(re.findall(r"[ɑɛiɪuɔ]", phonetic))
if number_of_vowels == 1 and check_accent:
phonetic = re.sub(r"([ɑɛiɪuɔ])", r"ˈ\1", phonetic)
phonetic = re.sub(r"([ɑɛiɪuo])", r"ˈ\1", phonetic)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two lines above we are counting vowels and using this list of characters: ɑɛiɪuɔ
And here we are using o instead of ɔ. As far as I can understand from the code, there is no chance, that the word at this point of the processing will have any o's, as they are unconditionally replaced with ɔ.

Copy link
Collaborator Author

@AnastasiaKuliak AnastasiaKuliak Jun 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to rewrite this. We need to add 'o' to the 'number_of_vowels' because otherwise stressing of 'o's works pretty randomly.

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.

3 participants