Class: AzureSTT::Models::Result
- Defined in:
- lib/azure_stt/models/result.rb
Overview
Model class for the results of a transcription when the transcription is successful
Instance Attribute Summary collapse
- #combined_recognized_phrases ⇒ Types::Array.of(CombinedRecognizedPhrases) readonly
- #duration ⇒ Types::Coercible::String readonly
- #duration_in_ticks ⇒ Types::Coercible::Integer readonly
- #recognized_phrases ⇒ Types::Array.of(RecognizedPhrases) readonly
- #source ⇒ Types::Coercible::String readonly
- #timestamp ⇒ Types::Date readonly
Instance Method Summary collapse
-
#sentences ⇒ Array[Models::Sentence]
Get all the best Models::Sentence of a result.
-
#text ⇒ String
The display field of the first CombinedRecognizedPhrases.
Instance Attribute Details
#combined_recognized_phrases ⇒ Types::Array.of(CombinedRecognizedPhrases) (readonly)
44 45 |
# File 'lib/azure_stt/models/result.rb', line 44 attribute :combined_recognized_phrases, Types::Array.of(CombinedRecognizedPhrases).default([].freeze) |
#duration ⇒ Types::Coercible::String (readonly)
36 |
# File 'lib/azure_stt/models/result.rb', line 36 attribute :duration, Types::Coercible::String |
#duration_in_ticks ⇒ Types::Coercible::Integer (readonly)
29 |
# File 'lib/azure_stt/models/result.rb', line 29 attribute :duration_in_ticks, Types::Coercible::Integer |
#recognized_phrases ⇒ Types::Array.of(RecognizedPhrases) (readonly)
52 53 |
# File 'lib/azure_stt/models/result.rb', line 52 attribute :recognized_phrases, Types::Array.of(RecognizedPhrase).default([].freeze) |
#source ⇒ Types::Coercible::String (readonly)
15 |
# File 'lib/azure_stt/models/result.rb', line 15 attribute :source, Types::Coercible::String |
#timestamp ⇒ Types::Date (readonly)
22 |
# File 'lib/azure_stt/models/result.rb', line 22 attribute :timestamp, Types::Date |
Instance Method Details
#sentences ⇒ Array[Models::Sentence]
Get all the best Models::Sentence of a result.
69 70 71 72 73 |
# File 'lib/azure_stt/models/result.rb', line 69 def sentences recognized_phrases.map do |recognized_phrase| recognized_phrase.n_best.first end end |
#text ⇒ String
The display field of the first CombinedRecognizedPhrases
60 61 62 |
# File 'lib/azure_stt/models/result.rb', line 60 def text combined_recognized_phrases.first.transcript end |