Sha256: cdc979be5c7e0fe867f0b755e3fa0dc276923ac4c5e777836ce52ef7d9d7abd4

Contents?: true

Size: 1.19 KB

Versions: 18

Compression:

Stored size: 1.19 KB

Contents

require 'ruby_speech/ssml/element'
require 'ruby_speech/xml/language'

module RubySpeech
  module SSML
    ##
    # As s element represents a sentence.
    # The use of s elements is optional. Where text occurs without an enclosing s element the synthesis processor should attempt to determine the structure using language-specific knowledge of the format of plain text.
    #
    # http://www.w3.org/TR/speech-synthesis/#S3.1.7
    #
    class S < Element

      %w{
        audio
        break
        desc
        emphasis
        mark
        p
        phoneme
        prosody
        say_as
        speak
        sub
        voice
      }.each { |f| require "ruby_speech/ssml/#{f}" }

      include XML::Language

      register :s

      VALID_CHILD_TYPES = [Nokogiri::XML::Element, Nokogiri::XML::Text, String, Audio, Break, Emphasis, Mark, Phoneme, Prosody, SayAs, Sub, Voice].freeze

      def <<(arg)
        raise InvalidChildError, "An S can only accept String, Audio, Break, Emphasis, Mark, Phoneme, Prosody, SayAs, Sub, Voice as children" unless VALID_CHILD_TYPES.include? arg.class
        super
      end

      def eql?(o)
        super o, :language
      end
    end # S
  end # SSML
end # RubySpeech

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ruby_speech-3.0.1-java lib/ruby_speech/ssml/s.rb
ruby_speech-3.0.1 lib/ruby_speech/ssml/s.rb
ruby_speech-3.0.0-java lib/ruby_speech/ssml/s.rb
ruby_speech-3.0.0 lib/ruby_speech/ssml/s.rb
ruby_speech-2.4.0-java lib/ruby_speech/ssml/s.rb
ruby_speech-2.4.0 lib/ruby_speech/ssml/s.rb
ruby_speech-2.3.2-java lib/ruby_speech/ssml/s.rb
ruby_speech-2.3.2 lib/ruby_speech/ssml/s.rb
ruby_speech-2.3.1-java lib/ruby_speech/ssml/s.rb
ruby_speech-2.3.1 lib/ruby_speech/ssml/s.rb
ruby_speech-2.3.0-java lib/ruby_speech/ssml/s.rb
ruby_speech-2.3.0 lib/ruby_speech/ssml/s.rb
ruby_speech-2.2.2-java lib/ruby_speech/ssml/s.rb
ruby_speech-2.2.2 lib/ruby_speech/ssml/s.rb
ruby_speech-2.2.1-java lib/ruby_speech/ssml/s.rb
ruby_speech-2.2.1 lib/ruby_speech/ssml/s.rb
ruby_speech-2.2.0-java lib/ruby_speech/ssml/s.rb
ruby_speech-2.2.0 lib/ruby_speech/ssml/s.rb