pronounce- A library for interfacing with the CMU Pronouncing Dictionary

Copyright(c) Noah Goodman 2018
Safe HaskellSafe



This module has functions for parsing the CMU pronouncing dictionary, and exports the CMUdict type and the function initDict to the main module Text.Pronounce



type Entry = Text Source #

Represents an entry word in the cmu pronouncing dictionary (simply an alias for Text to improve type specificity and readability

type Phones = [Text] Source #

Represents a string containing the phonetic breakdown of a word, in a similar manner to the EntryWord type

type CMUdict = Map Entry [Phones] Source #

A Map from Entrys to lists of possible pronunciations (Phones), serving as our representation of the CMU Pronouncing Dictionary

data DictSource Source #

Options for the initial source of the CMUDict. Currently, we can either parse from plaintext file or load preprocessed binary



initDict :: Maybe FilePath -> DictSource -> IO CMUdict Source #

Initializes the cmu pronunctiation dictionary into our program, given an optional file name of the dictionary

stdDict :: IO CMUdict Source #

Default settings for initDict

parseDict :: Text -> CMUdict Source #

Go through all the entries in the dictionary, parsing, and inserting into the map data structure

parseLine :: ReadP (String, String) Source #

Parses a line in the dictionary, returning as (key,val) pair, ignoring parenthetical part if it exists