Sha256: 5259000c85f2ca9425cf6e9d0b413d2f5a6698a728aed74b06cb3d1f1f09912a
Contents?: true
Size: 1.22 KB
Versions: 3
Compression:
Stored size: 1.22 KB
Contents
module RubySpeech module SSML ## # The sub element is employed to indicate that the text in the alias attribute value replaces the contained text for pronunciation. This allows a document to contain both a spoken and written form. The required alias attribute specifies the string to be spoken instead of the enclosed string. The processor should apply text normalization to the alias value. # # The sub element can only contain text (no elements). # # http://www.w3.org/TR/speech-synthesis/#S3.1.10 # class Sub < Element register :sub VALID_CHILD_TYPES = [Nokogiri::XML::Text, String].freeze ## # Indicates the string to be spoken instead of the enclosed string # # @return [String] # def alias read_attr :alias end ## # @param [String] other the string to be spoken instead of the enclosed string # def alias=(other) write_attr :alias, other end def <<(arg) raise InvalidChildError, "A Sub can only accept Strings as children" unless VALID_CHILD_TYPES.include? arg.class super end def eql?(o) super o, :alias end end # Sub end # SSML end # RubySpeech
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ruby_speech-1.0.0 | lib/ruby_speech/ssml/sub.rb |
ruby_speech-0.5.1 | lib/ruby_speech/ssml/sub.rb |
ruby_speech-0.5.0 | lib/ruby_speech/ssml/sub.rb |