<commit_before># alexa-ssml [![Build Status](https://travis-ci.org/nickclaw/alexa-ssml.svg?branch=master)](https://travis-ci.org/nickclaw/alexa-ssml)

Manipulate and validate the [subset of SSML](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference) supported by the [Alexa Skills Kit](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit)

> npm install alexa-ssml


### Example

```js
/** @jsx ssml */

import { ssml, renderToString } from 'alexa-ssml';

const tags = (
    <speak>
        Here is a number <w role="ivona:VBD">read</w> as a cardinal number:
        <sayAs interpretAs="cardinal">12345</sayAs>.
        Here is a word spelled out: <sayAs interpretAs="spell-out">hello</sayAs>.
    </speak>
);

const raw = renderToString(tags);
```

### Caveats

 * Only supports [limited syntax](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference)
 * Only supports `camelCase` tag names and properties.
 * `<break />` -> `<pause />` due to javascript reserved words.
 * Must use with `transform-react-jsx` [babel plugin](https://babeljs.io/docs/plugins/transform-react-jsx/).
<commit_msg>Add custom tag example to README<commit_after># alexa-ssml [![Build Status](https://travis-ci.org/nickclaw/alexa-ssml.svg?branch=master)](https://travis-ci.org/nickclaw/alexa-ssml)

Manipulate and validate the [subset of SSML](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference) supported by the [Alexa Skills Kit](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit)

> npm install alexa-ssml


### Example

```js
/** @jsx ssml */

import { ssml, renderToString } from 'alexa-ssml';

const tags = (
    <speak>
        Here is a number <w role="ivona:VBD">read</w> as a cardinal number:
        <sayAs interpretAs="cardinal">12345</sayAs>.
        Here is a word spelled out: <sayAs interpretAs="spell-out">hello</sayAs>.
    </speak>
);

const raw = renderToString(tags);
```

### Custom Elements

```
/** @jsx ssml */

import { ssml } from 'alexa-ssml';

function LongPause(props) {
    return <pause time={10000} />
}

const data = (
    <speak>
        Foo <LongPause /> bar.
    </speak>
)
```

### Caveats

 * Only supports [limited syntax](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference)
 * Only supports `camelCase` tag names and properties.
 * `<break />` -> `<pause />` due to javascript reserved words.
 * Must use with `transform-react-jsx` [babel plugin](https://babeljs.io/docs/plugins/transform-react-jsx/).

{'fraction_non_alphanumeric': 0.1628247347237468, 'fraction_numerical': 0.005488474204171241, 'mean_word_length': 4.062962962962963, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 31, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6898629', 'n_tokens_mistral': 1005, 'n_tokens_neox': 933, 'n_words': 187}