2

I create a dictionary and have a problem with converting Arpabet representation of a word to IPA (International Phonetic Alphabet) with stress.

In Arpabet, you can find which vowel has a stress with the number after the vowel. For example, the word "upstairs" has the following Aprabet representation: AH0 P S T EH1 R Z. The number 1 after EH means that stress falls upon this vowel.

The problem:
I have to convert Arpabet to IPA keeping the stress, but in IPA format the stress is put not before the vowel, but before the whole syllable (see picture below), which in some cases may start with multiple consonants. So I have no idea how to do it programmatically.

enter image description here

Question: What is the best way to show IPA representation of the incoming word with a stress? I'm interested in a solution in any programming language, but most preferably in PHP.

P.S. sorry for my English. Just learning :)

Oleg
  • 22,300
  • 9
  • 68
  • 84

1 Answers1

2

In order to do this correctly, you need to parse the syllables of the given word. See this question for a discussion on syllable-parsing. Once you have parsed the syllables in the arpabet string, simply find the vowel with stress and assign the stress to the beginning of the syllable.

Community
  • 1
  • 1
Lgiro
  • 762
  • 5
  • 13
  • 1
    Thank you for the reply:) I was able to solve this problem by determining which sounds are consonants and putting a stress before the one that is followed by a vowel; or directly before the vowel if it follows another vowel; or in the beginning of the word if there are no other vowels before. This algorithm is not too accurate, but in my case it's fine. Maybe I'll post PHP code for this if I find time – Oleg Oct 23 '15 at 14:48