Mapping graphemes to phonemes in CMUDict
We just finished a project for which we developed a Phonics Engine (see paper https://www.researchgate.net/publication/280147388_Building_a_Phonics_Engine_for_Automated_Text_Guidance) that does exactly that. We have a dictionary (BrEng) that produces mappings such as b:b,a:@,tch:tS - both the code and the final dictionary are available but, unfortunately, the mapping code is very rough and ready and required lots of manual tweaks. Here's the code on GitHub: https://github.com/mpakarlsson/ilearnrw/tree/master/src/ilearnrw/languagetools/english.
Edit: The key files are probably just embedded in the Java code somewhere, so I started a separate repo for the language source files here: github.com/techczech/phonicsengine.
Original answer: Linguistics Stack Exchange. Licence: CC BY-SA 3.0. Original question by Chris Wilson: Mapping graphemes to phonemes in CMUDict. Contributing editors: Benjamin Abdi.