1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Speechmatics ASR REST API
*
* The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results.
*
* The version of the OpenAPI document: 2.0.0
* Contact: support@speechmatics.com
* Generated by: https://openapi-generator.tech
*/
use crate::batch::models;
use serde::{Deserialize, Serialize};
/// RecognitionResult : An ASR job output item. The primary item types are `word` and `punctuation`. Other item types may be present, for example to provide semantic information of different forms.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RecognitionResult {
#[serde(rename = "channel", skip_serializing_if = "Option::is_none")]
pub channel: Option<String>,
#[serde(rename = "start_time")]
pub start_time: f32,
#[serde(rename = "end_time")]
pub end_time: f32,
/// Whether the punctuation mark is an end of sentence character. Only applies to punctuation marks.
#[serde(rename = "is_eos", skip_serializing_if = "Option::is_none")]
pub is_eos: Option<bool>,
/// New types of items may appear without being requested; unrecognized item types can be ignored.
#[serde(rename = "type")]
pub type_value: Type,
#[serde(rename = "alternatives", skip_serializing_if = "Option::is_none")]
pub alternatives: Option<Vec<models::RecognitionAlternative>>,
}
impl RecognitionResult {
/// An ASR job output item. The primary item types are `word` and `punctuation`. Other item types may be present, for example to provide semantic information of different forms.
pub fn new(start_time: f32, end_time: f32, type_value: Type) -> RecognitionResult {
RecognitionResult {
channel: None,
start_time,
end_time,
is_eos: None,
type_value,
alternatives: None,
}
}
}
/// New types of items may appear without being requested; unrecognized item types can be ignored.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "word")]
Word,
#[serde(rename = "punctuation")]
Punctuation,
}
impl Default for Type {
fn default() -> Type {
Self::Word
}
}