word_info v0.1.0 WordInfo View Source
Get the pronunciation and frequency information of a word.
Syllables
iex> WordInfo.syllables("tradition")
["tra", "di", "tion"]
ARPABET pronunciation phonemes
iex> WordInfo.arpabet("halfway")
["HH", "AE1", "F", "W", "EY1"]
IPA pronunciation phonemes
iex> WordInfo.ipa("halfway")
["ˈhæfˈweɪ"]
Word frequency
iex> WordInfo.frequency("scientist")
5499
The number 5499
means it's ranked at 5499 on frequncy.
Acknowledgements
Here are the data sources of this library, without which this library is impossible.
- syllables - 43,000 words from Gary Darby's DFF project
- IPA style pronunciation - 125,000 word pronunciations from cmudict-ipa project
- ARPABET style pronunciation - 130,000 word pronunciations from CMU Dict
- frequency - usage frequency ranking of 33,000+ words from Brown Corpus of American English and cmudict-ipa
Link to this section Summary
Functions
Fetch the pronunciation of a word from CMU dictionary, in ARPABET format
Fetch the frequency rating of a word.
Fetch the pronunciation of a word from CMU dictionary, with IPA pronu
Split the headword into syllables
Link to this section Functions
Fetch the pronunciation of a word from CMU dictionary, in ARPABET format
See also: https://en.wikipedia.org/wiki/ARPABET
Returnss
:unknown
if not found in the dictionary- A list of ARPABET phonemes.
Examples
iex> WordInfo.arpabet("world")
["W", "ER1", "L", "D"]
iex> WordInfo.arpabet("semi-colon")
["S", "EH1", "M", "IY0", "K", "OW1", "L", "AH0", "N"]
Fetch the frequency rating of a word.
The rating is based on data from cmudict-ipa, which uses Brown Corpus of American English originally.
Returnss
:unknown
if not found in the dictionary- an rating number, the smaller the frequenter. For instance,
1
is the most used word"THE"
.
Examples
iex> WordInfo.frequency("traditional")
1365
iex> WordInfo.frequency("some-unknown-word")
:unkown
Fetch the pronunciation of a word from CMU dictionary, with IPA pronu
Returnss
:unknown
if not found in the dictionary- A list of IPA pronunciations, all for the full word.
Examples
iex> WordInfo.ipa("world")
["ˈwɝːld"]
iex> WordInfo.ipa("semi-colon")
["ˈsɛmiːˈkoʊlən,", "ˈsɛməˈkoʊlən"]
iex> WordInfo.ipa("lalalal")
:unknown
Split the headword into syllables
Returnss
:unknown
if not found in the dictionary- A list of syllables.
Example
iex> WordInfo.syllables("edition")
["e", "di", "tion"]
iex> WordInfo.syllables("something-not-in-the-dictionary")
:unknown