Git Product home page Git Product logo

ssmlverifier's Introduction

SSMLVerifier

SSMLVerifier will verify that a given input is valid SSML. It is based of a javascript implementation found here: https://github.com/gsdriver/ssml-check

Build status master NuGet version

WIP

This is a WIP project. Here is the current state of the implementation:

Common tags:

  • #049b2c audio
  • #049b2c break
  • #049b2c emphasis
  • #049b2c p
  • #049b2c prosody
  • #049b2c s
  • #049b2c say-as
  • #049b2c speak
  • #049b2c sub

Amazon tags:

  • #049b2c amazon:domain
  • #049b2c amazon:effect
  • #049b2c amazon:emotion
  • #049b2c lang
  • #049b2c phoneme
  • #c5f015 voice
  • #049b2c w

Google tags:

  • #049b2c par
  • #049b2c seq
  • #049b2c media
  • #049b2c desc

Basic usage

The basic usage looks like this:

const string testSsml = "<speak>Hello <break strength='weak' time='1s'/> World!</speak>";
var verifier = new Verifer();
var errors = verifier.Verify(testSsml);
if(errors.Count() == 0)
{
   Console.WriteLine("SSML is valid!");
}
else
{
   foreach(var error in errors)
   {
      Console.WriteLine(error.Error);
   }
}

But I'd recommend you to use the second parameter aswell, which sets the target platform.

verifier.Verify(testSsml, SsmlPlatform.Amazon);
// or ...
verifier.Verify(testSsml, SsmlPlatform.Google);

This way you are able to use platform specific tags like Amazon's lang-tag

// lang is an amazon-specific tag
const string testSsml = "<speak>Hello <lang xml:lang='de-DE'>Welt</lang></speak>";
var verifier = new Verifer();
// this will fail, because lang is a Amazon-specific tag
var result = verifier.Verify(testSsml, SsmlPlatform.Google); 

ssmlverifier's People

Contributors

janniksam avatar

Stargazers

 avatar  avatar

Watchers

 avatar

ssmlverifier's Issues

time-attribute needs to be validated

A validator for the time-attribute needs to be right.

See the occurances:
todo:
break -> time
audio -> clipBegin
audio -> clipEnd
audio -> repeatDur
done:
media -> repeatdur
media -> fadeInDur
media -> fadeOutDur

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.