Closed bklang closed 10 years ago
nlsml = RubySpeech.parse <<_EOF <result xmlns="http://www.ietf.org/xml/ns/mrcpv2" grammar="http://grammar"> <interpretation confidence="0.63"> <instance> <target> <string>garage door</string> </target> </instance> </interpretation> </result> _EOF puts nlsml.interpretations.first[:instance][:action]
Yields:
<NoMethodError> undefined method `content' for nil:NilClass /home/vagrant/.rvm/gems/ruby-2.1.1/gems/ruby_speech-2.3.1/lib/ruby_speech/nlsml/document.rb:61:in `input_hash_for_interpretation' /home/vagrant/.rvm/gems/ruby-2.1.1/gems/ruby_speech-2.3.1/lib/ruby_speech/nlsml/document.rb:105:in `interpretation_hash_for_interpretation' /home/vagrant/.rvm/gems/ruby-2.1.1/gems/ruby_speech-2.3.1/lib/ruby_speech/nlsml/document.rb:21:in `block in interpretations' /home/vagrant/.rvm/gems/ruby-2.1.1/gems/ruby_speech-2.3.1/lib/ruby_speech/nlsml/document.rb:20:in `map' /home/vagrant/.rvm/gems/ruby-2.1.1/gems/ruby_speech-2.3.1/lib/ruby_speech/nlsml/document.rb:20:in `interpretations'
Part of the problem here is the invalid NLSML (the <string/> wrapper). Another problem is that the API for drawling NLSML is different from GRXML and SSML, leading to confusion.
<string/>
Yields: