speechmarkdown / speechmarkdown-js

Speech Markdown grammar, parser, and formatters for use with JavaScript.
MIT License
76 stars 16 forks source link

Add dictionary to options for sub and phoneme #47

Closed rmtuckerphx closed 1 year ago

rmtuckerphx commented 4 years ago

The SpeechMarkdown class or toSSML method accepts an options object. Add a dictionary element to options to allow for a dictionary of words or phrases that will be converted to a phoneme SSML tag if the platform supports it (Alexa) or a sub SSML tag otherwise (Google).

The structure would be something like this:

[
  {
    "text": "potato",
    "ipa": "pəˈteɪtəʊ",
    "sub": "poteytoh",
    "section": "food",
  }
]

See https://github.com/cellular/jovo-plugin-ssml

Need to decide if:

Could also specify a section for each word so only a subsection of the dictionary will be checked: (potato)[dictionary:"food"]

arjan commented 1 year ago

Closing issue due to no activity