pronounce-1.1.0.1: A Haskell library for interfacing with the CMU Pronouncing Dictionary

Copyright(c) Noah Goodman 2018
LicenseBSD3
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Text.Pronounce.ParseDict

Description

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

Synopsis

Documentation

type CMUdict = Map Text [Text] Source #

A Map from Entries to lists of possible pronunciations, serving as our representation of the CMU Pronouncing Dictionary

type UsesBin = Bool Source #

A type used to represent the option of decoding the dictionary from a binary file or parsing it from text

initDict :: Maybe FilePath -> UsesBin -> 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