Details and Options
ResourceFunction["WordPhoneticSyllabify"] takes the following options:
AllowMissing | False | whether to return Missing for an unknown word when there is no OpenAI key. |
Stress | "Phonetic" | whether to mark primary and secondary stress ( ˈ and ˌ ) for phonetics, or on and off beats ( ↑ and ↓ ) for poetic meter. |
With the option AllowMissing set to False (default), whenever ResourceFunction["WordPhoneticSyllabify"] encounters
w such that
WordData[w,"Phonetic Form"]==Missing["NotAvailable"], the Wolfram system will check whether LLM credentials are set, prompting the user if they are not.
With the
AllowMissing option set to
True,
ResourceFunction["WordPhoneticSyllabify"] returns
Missing when there is no OpenAI key saved and otherwise uses an LLM to resolve the unknown word's phonetics. This may be preferable when mapping WordPhoneticSyllabify over a list of words.
The "Stress" option, when set to "Metric", changes the phonetic part of the output from having primary and secondary stress marks (ˈ and ˌ) common in phonetics, to having marks for stressed and unstressed syllables (↑ and ↓) for the analysis of poetic meter.
You can check whether an API Key is set by evaluating
SystemCredential["OPENAI_API_KEY"]. If needed, the key can be set using
SystemCredential["OPENAI_API_KEY"]="your-key-here".
ResourceFunction["WordPhoneticSyllabify"] places a bullet character • between each syllable.
ResourceFunction["WordPhoneticSyllabify"] syllabifies the two parts of compound words separately.
ResourceFunction["WordPhoneticSyllabify"] divides syllables using the Maximal Onset Principal, and does not take morphology into consideration.
ResourceFunction["WordPhoneticSyllabify"] is case-insensitive and returns results in lower case.
The second item of the output consists of phonetic symbols, some of which can be confused with keyboard characters including ɡ (LatinSmallLetterScriptG), ˈ (ModifierLetterVerticalLine), and ˌ ("ModifierLetterLowVerticalLine").
Phonetic output of
ResourceFunction["WordPhoneticSyllabify"][w] is General American English consistent with
WordData[w,"PhoneticForm"], even if
w is not English or includes characters that are not part of the English alphabet.
Though similar, phonetic syllabification follows different rules than either hyphenation or morphologic syllabification, the most notable difference being consonant sounds that attach to the beginning of syllables if phonetically feasible (e.g., strˈaɪ•kɪŋ instead of strˈaɪk•ɪŋ).
ResourceFunction["WordPhoneticSyllabify"] has the attribute
Listable.