Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4 Fix IPA pronunciations in Dictionary Apps
Tiger only hintThe Dictionary app, which debuted in 10.4, offers the ability to display pronunciations in (among other choices) US English (IPA) (International Phonetic Alphabet) in its preferences.

Unfortunately, the pronunciations given have some glaring errors. For example, the symbols for primary and secondary stress are swapped, and the symbol for the vowel sound of "cat" and "plan" is incorrect.

Thankfully, Apple had the forethought to keep the dictionary in an unencrypted XML format in /Library -> Dictionaries -> New Oxford American Dictionary.dict -> Contents -> dict_body. Thus, the following command will fix the dictionary in place:
$ perl -pi -e 's/\303\270/\303\246/g; tr/\313\214\313\210/\313\210\313\214/'\
 /Library/Dictionaries/New\ Oxford\ American\ Dictionary.dict/\
Contents/dict_body
Use -pi.bak (instead of -pi, after perl) if you want to make a backup of the dict_body file, which is 75 megabytes.

Note: This does break a few words which had their stress correctly marked originally, such as "Cupertino;" their stress is now backwards. It appears that the number of words with correct stress originally is a vanishingly small handful that were manually added by Apple, so while this fix doesn't fix everything, it makes most things correct.

Probably not many people care about IPA pronunciations, but for those of us who do, we really want them to be right! I also filed this as bugs 4225277 and 4225267 using bugreport.apple.com.

[robg adds: I tested this one by copying and pasting the above command, and it worked as described. I also manually backed up the dictionary, just in case...]
    •    
  • Currently 3.10 / 5
  You rated: 2 / 5 (10 votes cast)
 
[18,223 views]  

10.4 Fix IPA pronunciations in Dictionary | 11 comments | Create New Account
Click here to return to the '10.4 Fix IPA pronunciations in Dictionary' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4 Fix IPA pronunciations in Dictionary
Authored by: chabig on Aug 29, '05 10:03:12AM

My stress marks aren't swapped. Every word I checked has the correct primary and secondary stress marks. For example, "transportation" is listed as ?transp?r?t? sh ?n

I wish the original poster would have offered some examples of incorrect stress marks. Perhaps his dictionary was corrupted somehow.



[ Reply to This | # ]
10.4 Fix IPA pronunciations in Dictionary
Authored by: tarrant on Aug 29, '05 10:34:33AM

The original poster is referring specifically to the IPA pronunciations (use preferences to select between pronunciation schemes). I'm not an expert & can't really judge whether they're right or wrong, but the American are clearly quite different from the British (and the stress marks do look reversed in some words such as 'transportation').



[ Reply to This | # ]
10.4 Fix IPA pronunciations in Dictionary
Authored by: chabig on Aug 29, '05 10:08:42AM

Also, the original poster doesn't say why the vowel for 'cat' and 'plan' is incorrect. The Dictionary's pronunciation of 'cat' and 'plan' is exactly the same as shown by Merriam-Webster's online dictionary. (http://www.m-w.com).



[ Reply to This | # ]
10.4 Fix IPA pronunciations in Dictionary
Authored by: latelio on Aug 29, '05 12:05:38PM

well, there are several ways of giving an explanation about how words are to be pronounced.
The Merriam-Webster does not use the IPA (International Phonetic Alphabet), but a system which is considered to be easier to read for English speaking users.

The IPA is more useful for people who have to handle with several languages, as one symbol does correspond to one sound – in any language IPA is used. So /kat/ (for the animal) may be useful for English speakers, but /a/ does correspond rather to engl. LAS (Vegas) (as I pronounce it...) or spanish MADRE or german TAG.
The IPA symbol would rather be æ (a and e joint together as a ligature).



[ Reply to This | # ]
10.4 Fix IPA pronunciations in Dictionary
Authored by: cobbe on Aug 30, '05 07:44:52AM
If you have pronunciation set to "US English (IPA)" in the Dictionary's preferences dialog, then with the unmodified dictionary, the pronunciation of "plan" is rendered as |pløn| (i.e., Unicode 00F8). But ø is the IPA symbol for the vowel in German schön or French feu. The correct IPA symbol for the vowel in US English "plan" is æ, Unicode 00E6.

As far as I know, the "US English (Diacritical)" pronunciations are correct, though I haven't investigated this in detail. Further, I'm only working with Dictionary.app, not the Dashboard widget, so I have no idea if the two are different.

[ Reply to This | # ]

10.4.8: Apple still hasn't fixed IPA pronunciations
Authored by: Moofisto on Dec 22, '06 08:40:10PM

The IPA pronunciations are still wrong even though it appears Apple just has to switch a few characters, while minding their own additions.

While the "ø" thing affects the US IPA pronunciations, the stress mark reversal affects both the US and British IPA settings. The US Diacritical (default) is shown correctly.

I want to thank nohat for the fix and filing the bug reports, even as Apple doesn't seem to have time to fix it for Americans who use IPA. I wonder if all the stress marks are wrong by default for British OS X users.

I set my Dictionary.app to use US IPA because I wanted to learn IPA and follow Wikipedia pronunciations.

I noticed the use of "ø" in place of /æ/ right away. I was pissed at the Oxford University Press for using a separate IPA variant for Americans, as if we really needed more pronunciation keys. Since OUP already uses "a" for /æ/ , as you can see with Dictionary.app by switching to British IPA, I thought they also were using "ø" in a weird way. I don't see why they would use "ø" for /æ/ as /ø/ is nowhere close to that sound: it's the difference between the vowel sounds of "cat" and "bird".

To see the various pronunciations of a word in Dictionary.app, besides changing the preference setting, you may have to lookup the word again --but with an extra space or two in a query-- to get it to reload the definition and pronunciation.

@Cobbes, Dictionary.wdgt accesses the same dataset and pronunciation preference as Dictionary.app.



[ Reply to This | # ]
10.5: slash-o's are back in Leopard
Authored by: mzajac on Dec 01, '07 03:50:38PM

I upgraded to Leopard, and it appears that the dictionary database has been updated, unfortunately with the slash-o's intact in the US IPA pronunciation.

I'm not sure about stress symbols—I see primary and secondary stress used correctly in "electrification", "syllabify", and elsewhere, but a strange use of a double high line for secondary stress in "apropos" and others.

(Also, many derivatives appear to mix the American diacritical system in with US IPA. Examples: "syllabification", "optimality" and "optimally", "stipulation" and "stipulator")

Any response to bugs filed with Apple? Will the original fix still work in Leopard?



[ Reply to This | # ]
10.5: slash-o's are back in Leopard
Authored by: Rhywun on Jan 14, '08 08:33:16PM

Yes, I noticed a lot of this too, both in Tiger and now Leopard. It's so broken that it's useless. For example, set it to "Diacritical" and you still get a mixture of Webster's and IPA. (And "stipulate" becomes "steepulate"....) Sigh.

I'd just as soon turn it off.



[ Reply to This | # ]
10.5: the fix won't work in Leopard.
Authored by: mzajac on Feb 12, '08 11:19:12AM

It looks like Leopard's dictionary data is stored in a binary format, so the fix in this hint won't work any more. The data stored in a 42.8 MB file at a slightly different path:

/Library/Dictionaries/New Oxford American Dictionary.dictionary/Contents/Body.data



[ Reply to This | # ]
10.5: the fix won't work in Leopard.
Authored by: p0pper on Apr 19, '10 12:59:37AM

though this is quite an old thread, i'd just like to note that the issue has finally been fixed in snow leopard (at least 10.6.3 or later)

---
::::::::::::::::::::::::::::::::::::::
Decay heat is not ordered information.
-Patrick Lui (SLAC)
::::::::::::::::::::::::::::::::::::::



[ Reply to This | # ]
10.4 Fix IPA pronunciations in Dictionary
Authored by: p0pper on May 10, '09 10:31:42PM

ha! wow. thank you so much for making me feel like so much less of a closet geek for fuming whenever i saw a mid-high front rounded vowel in place of a low front unrounded one. the perl script worked flawlessly, and the vowel displays correctly now. i didn't really care about the stress marks, but it does look better with those mostly fixed.

ps, where did you find the octal codes for the characters? (they are octal, right?)

-p
.

---
::::::::::::::::::::::::::::::::::::::
Decay heat is not ordered information.
-Patrick Lui (SLAC)
::::::::::::::::::::::::::::::::::::::



[ Reply to This | # ]