Class: AzureSTT::Models::Result

Inherits:
Base
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#combined_recognized_phrasesTypes::Array.of(CombinedRecognizedPhrases) (readonly)

Returns:



44
45
# File 'lib/azure_stt/models/result.rb', line 44

attribute :combined_recognized_phrases,
Types::Array.of(CombinedRecognizedPhrases).default([].freeze)

#durationTypes::Coercible::String (readonly)

Returns:

  • (Types::Coercible::String)


36
# File 'lib/azure_stt/models/result.rb', line 36

attribute :duration, Types::Coercible::String

#duration_in_ticksTypes::Coercible::Integer (readonly)

Returns:

  • (Types::Coercible::Integer)


29
# File 'lib/azure_stt/models/result.rb', line 29

attribute :duration_in_ticks, Types::Coercible::Integer

#recognized_phrasesTypes::Array.of(RecognizedPhrases) (readonly)

Returns:

  • (Types::Array.of(RecognizedPhrases))


52
53
# File 'lib/azure_stt/models/result.rb', line 52

attribute :recognized_phrases,
Types::Array.of(RecognizedPhrase).default([].freeze)

#sourceTypes::Coercible::String (readonly)

Returns:

  • (Types::Coercible::String)


15
# File 'lib/azure_stt/models/result.rb', line 15

attribute :source, Types::Coercible::String

#timestampTypes::Date (readonly)

Returns:

  • (Types::Date)


22
# File 'lib/azure_stt/models/result.rb', line 22

attribute :timestamp, Types::Date

Instance Method Details

#sentencesArray[Models::Sentence]

Get all the best Models::Sentence of a result.

Returns:



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

#textString

The display field of the first CombinedRecognizedPhrases

Returns:

  • (String)


60
61
62
# File 'lib/azure_stt/models/result.rb', line 60

def text
  combined_recognized_phrases.first.transcript
end