cielo24 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cielo24.rb +9 -9
- data/lib/cielo24/actions.rb +287 -274
- data/lib/cielo24/enums.rb +153 -153
- data/lib/cielo24/options.rb +219 -219
- data/lib/cielo24/version.rb +3 -3
- data/lib/cielo24/web_utils.rb +101 -74
- metadata +17 -3
data/lib/cielo24/enums.rb
CHANGED
@@ -1,154 +1,154 @@
|
|
1
|
-
module Cielo24
|
2
|
-
class BaseEnum < BasicObject
|
3
|
-
def self.all
|
4
|
-
all_enums = []
|
5
|
-
self.constants(false).each{ |const_name|
|
6
|
-
all_enums.push(self.const_get(const_name))
|
7
|
-
}
|
8
|
-
return all_enums
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
class ErrorType < BaseEnum
|
13
|
-
LOGIN_INVALID = 'LOGIN_INVALID'
|
14
|
-
ACCOUNT_EXISTS = 'ACCOUNT_EXISTS'
|
15
|
-
ACCOUNT_DOES_NOT_EXIST = 'ACCOUNT_DOES_NOT_EXIST'
|
16
|
-
ACCOUNT_UNPRIVILEGED = 'ACCOUNT_UNPRIVILEGED'
|
17
|
-
BAD_API_TOKEN = 'BAD_API_TOKEN'
|
18
|
-
INVALID_QUERY = 'INVALID_QUERY'
|
19
|
-
INVALID_OPTION = 'INVALID_OPTION'
|
20
|
-
INVALID_URL = 'INVALID_URL'
|
21
|
-
MISSING_PARAMETER = 'MISSING_PARAMETER'
|
22
|
-
NOT_IMPLEMENTED = 'NOT_IMPLEMENTED'
|
23
|
-
ITEM_NOT_FOUND = 'ITEM_NOT_FOUND'
|
24
|
-
INVALID_RETURN_HANDLERS = 'INVALID_RETURN_HANDLERS'
|
25
|
-
NOT_PARENT_ACCOUNT = 'NOT_PARENT_ACCOUNT'
|
26
|
-
NO_CHILDREN_FOUND = 'NO_CHILDREN_FOUND'
|
27
|
-
UNHANDLED_ERROR = 'UNHANDLED_ERROR'
|
28
|
-
end
|
29
|
-
|
30
|
-
class JobStatus < BaseEnum
|
31
|
-
AUTHORIZING = 'Authorizing'
|
32
|
-
PENDING = 'Pending'
|
33
|
-
IN_PROCESS = 'In Process'
|
34
|
-
COMPLETE = 'Complete'
|
35
|
-
MEDIA_FAILURE = 'Media Failure'
|
36
|
-
REVIEWING = 'Reviewing'
|
37
|
-
end
|
38
|
-
|
39
|
-
class Priority < BaseEnum
|
40
|
-
ECONOMY = 'ECONOMY'
|
41
|
-
STANDARD = 'STANDARD'
|
42
|
-
PRIORITY = 'PRIORITY'
|
43
|
-
CRITICAL = 'CRITICAL'
|
44
|
-
end
|
45
|
-
|
46
|
-
class Fidelity < BaseEnum
|
47
|
-
MECHANICAL = 'MECHANICAL'
|
48
|
-
PREMIUM = 'PREMIUM'
|
49
|
-
PROFESSIONAL = 'PROFESSIONAL'
|
50
|
-
end
|
51
|
-
|
52
|
-
class CaptionFormat < BaseEnum
|
53
|
-
SRT = 'SRT'
|
54
|
-
SBV = 'SBV'
|
55
|
-
SCC = 'SCC'
|
56
|
-
DFXP = 'DFXP'
|
57
|
-
QT = 'QT'
|
58
|
-
TRANSCRIPT = 'TRANSCRIPT'
|
59
|
-
TWX = 'TWX'
|
60
|
-
TPM = 'TPM'
|
61
|
-
WEB_VTT = 'WEB_VTT'
|
62
|
-
ECHO = 'ECHO'
|
63
|
-
end
|
64
|
-
|
65
|
-
class TokenType < BaseEnum
|
66
|
-
WORD = 'word'
|
67
|
-
PUNCTUATION = 'punctuation'
|
68
|
-
SOUND = 'sound'
|
69
|
-
end
|
70
|
-
|
71
|
-
class SoundTag < BaseEnum
|
72
|
-
UNKNOWN = 'UNKNOWN'
|
73
|
-
INAUDIBLE = 'INAUDIBLE'
|
74
|
-
CROSSTALK = 'CROSSTALK'
|
75
|
-
MUSIC = 'MUSIC'
|
76
|
-
NOISE = 'NOISE'
|
77
|
-
LAUGH = 'LAUGH'
|
78
|
-
COUGH = 'COUGH'
|
79
|
-
FOREIGN = 'FOREIGN'
|
80
|
-
BLANK_AUDIO = 'BLANK_AUDIO'
|
81
|
-
APPLAUSE = 'APPLAUSE'
|
82
|
-
BLEEP = 'BLEEP'
|
83
|
-
ENDS_SENTENCE = 'ENDS_SENTENCE'
|
84
|
-
end
|
85
|
-
|
86
|
-
class SpeakerId < BaseEnum
|
87
|
-
NO = 'no'
|
88
|
-
NUMBER = 'number'
|
89
|
-
NAME = 'name'
|
90
|
-
end
|
91
|
-
|
92
|
-
class SpeakerGender < BaseEnum
|
93
|
-
UNKNOWN = 'UNKNOWN'
|
94
|
-
MALE = 'MALE'
|
95
|
-
FEMALE = 'FEMALE'
|
96
|
-
end
|
97
|
-
|
98
|
-
class Case < BaseEnum
|
99
|
-
UPPER = 'upper'
|
100
|
-
LOWER = 'lower'
|
101
|
-
UNCHANGED = ''
|
102
|
-
end
|
103
|
-
|
104
|
-
class LineEnding < BaseEnum
|
105
|
-
UNIX = 'UNIX'
|
106
|
-
WINDOWS = 'WINDOWS'
|
107
|
-
OSX = 'OSX'
|
108
|
-
end
|
109
|
-
|
110
|
-
class CustomerApprovalStep < BaseEnum
|
111
|
-
TRANSLATION = 'TRANSLATION'
|
112
|
-
RETURN = 'RETURN'
|
113
|
-
end
|
114
|
-
|
115
|
-
class CustomerApprovalTool < BaseEnum
|
116
|
-
AMARA = 'AMARA'
|
117
|
-
CIELO24 = 'CIELO24'
|
118
|
-
end
|
119
|
-
|
120
|
-
class Language < BaseEnum
|
121
|
-
ENGLISH = 'en'
|
122
|
-
FRENCH = 'fr'
|
123
|
-
SPANISH = 'es'
|
124
|
-
GERMAN = 'de'
|
125
|
-
MANDARIN_CHINESE = 'cmn'
|
126
|
-
PORTUGUESE = 'pt'
|
127
|
-
JAPANESE = 'jp'
|
128
|
-
ARABIC = 'ar'
|
129
|
-
KOREAN = 'ko'
|
130
|
-
TRADITIONAL_CHINESE = 'zh'
|
131
|
-
HINDI = 'hi'
|
132
|
-
ITALIAN = 'it'
|
133
|
-
RUSSIAN = 'ru'
|
134
|
-
TURKISH = 'tr'
|
135
|
-
HEBREW = 'he'
|
136
|
-
end
|
137
|
-
|
138
|
-
class IWP < BaseEnum
|
139
|
-
PREMIUM = 'PREMIUM'
|
140
|
-
INTERIM_PROFESSIONAL = 'INTERIM_PROFESSIONAL'
|
141
|
-
PROFESSIONAL = 'PROFESSIONAL'
|
142
|
-
SPEAKER_ID = 'SPEAKER_ID'
|
143
|
-
FINAL = 'FINAL'
|
144
|
-
MECHANICAL = 'MECHANICAL'
|
145
|
-
CUSTOMER_APPROVED_RETURN = 'CUSTOMER_APPROVED_RETURN'
|
146
|
-
CUSTOMER_APPROVED_TRANSLATION = 'CUSTOMER_APPROVED_TRANSLATION'
|
147
|
-
end
|
148
|
-
|
149
|
-
class JobDifficulty < BaseEnum
|
150
|
-
GOOD = 'Good'
|
151
|
-
BAD = 'Bad'
|
152
|
-
UNKNOWN = 'Unknown'
|
153
|
-
end
|
1
|
+
module Cielo24
|
2
|
+
class BaseEnum < BasicObject
|
3
|
+
def self.all
|
4
|
+
all_enums = []
|
5
|
+
self.constants(false).each{ |const_name|
|
6
|
+
all_enums.push(self.const_get(const_name))
|
7
|
+
}
|
8
|
+
return all_enums
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class ErrorType < BaseEnum
|
13
|
+
LOGIN_INVALID = 'LOGIN_INVALID'
|
14
|
+
ACCOUNT_EXISTS = 'ACCOUNT_EXISTS'
|
15
|
+
ACCOUNT_DOES_NOT_EXIST = 'ACCOUNT_DOES_NOT_EXIST'
|
16
|
+
ACCOUNT_UNPRIVILEGED = 'ACCOUNT_UNPRIVILEGED'
|
17
|
+
BAD_API_TOKEN = 'BAD_API_TOKEN'
|
18
|
+
INVALID_QUERY = 'INVALID_QUERY'
|
19
|
+
INVALID_OPTION = 'INVALID_OPTION'
|
20
|
+
INVALID_URL = 'INVALID_URL'
|
21
|
+
MISSING_PARAMETER = 'MISSING_PARAMETER'
|
22
|
+
NOT_IMPLEMENTED = 'NOT_IMPLEMENTED'
|
23
|
+
ITEM_NOT_FOUND = 'ITEM_NOT_FOUND'
|
24
|
+
INVALID_RETURN_HANDLERS = 'INVALID_RETURN_HANDLERS'
|
25
|
+
NOT_PARENT_ACCOUNT = 'NOT_PARENT_ACCOUNT'
|
26
|
+
NO_CHILDREN_FOUND = 'NO_CHILDREN_FOUND'
|
27
|
+
UNHANDLED_ERROR = 'UNHANDLED_ERROR'
|
28
|
+
end
|
29
|
+
|
30
|
+
class JobStatus < BaseEnum
|
31
|
+
AUTHORIZING = 'Authorizing'
|
32
|
+
PENDING = 'Pending'
|
33
|
+
IN_PROCESS = 'In Process'
|
34
|
+
COMPLETE = 'Complete'
|
35
|
+
MEDIA_FAILURE = 'Media Failure'
|
36
|
+
REVIEWING = 'Reviewing'
|
37
|
+
end
|
38
|
+
|
39
|
+
class Priority < BaseEnum
|
40
|
+
ECONOMY = 'ECONOMY'
|
41
|
+
STANDARD = 'STANDARD'
|
42
|
+
PRIORITY = 'PRIORITY'
|
43
|
+
CRITICAL = 'CRITICAL'
|
44
|
+
end
|
45
|
+
|
46
|
+
class Fidelity < BaseEnum
|
47
|
+
MECHANICAL = 'MECHANICAL'
|
48
|
+
PREMIUM = 'PREMIUM'
|
49
|
+
PROFESSIONAL = 'PROFESSIONAL'
|
50
|
+
end
|
51
|
+
|
52
|
+
class CaptionFormat < BaseEnum
|
53
|
+
SRT = 'SRT'
|
54
|
+
SBV = 'SBV'
|
55
|
+
SCC = 'SCC'
|
56
|
+
DFXP = 'DFXP'
|
57
|
+
QT = 'QT'
|
58
|
+
TRANSCRIPT = 'TRANSCRIPT'
|
59
|
+
TWX = 'TWX'
|
60
|
+
TPM = 'TPM'
|
61
|
+
WEB_VTT = 'WEB_VTT'
|
62
|
+
ECHO = 'ECHO'
|
63
|
+
end
|
64
|
+
|
65
|
+
class TokenType < BaseEnum
|
66
|
+
WORD = 'word'
|
67
|
+
PUNCTUATION = 'punctuation'
|
68
|
+
SOUND = 'sound'
|
69
|
+
end
|
70
|
+
|
71
|
+
class SoundTag < BaseEnum
|
72
|
+
UNKNOWN = 'UNKNOWN'
|
73
|
+
INAUDIBLE = 'INAUDIBLE'
|
74
|
+
CROSSTALK = 'CROSSTALK'
|
75
|
+
MUSIC = 'MUSIC'
|
76
|
+
NOISE = 'NOISE'
|
77
|
+
LAUGH = 'LAUGH'
|
78
|
+
COUGH = 'COUGH'
|
79
|
+
FOREIGN = 'FOREIGN'
|
80
|
+
BLANK_AUDIO = 'BLANK_AUDIO'
|
81
|
+
APPLAUSE = 'APPLAUSE'
|
82
|
+
BLEEP = 'BLEEP'
|
83
|
+
ENDS_SENTENCE = 'ENDS_SENTENCE'
|
84
|
+
end
|
85
|
+
|
86
|
+
class SpeakerId < BaseEnum
|
87
|
+
NO = 'no'
|
88
|
+
NUMBER = 'number'
|
89
|
+
NAME = 'name'
|
90
|
+
end
|
91
|
+
|
92
|
+
class SpeakerGender < BaseEnum
|
93
|
+
UNKNOWN = 'UNKNOWN'
|
94
|
+
MALE = 'MALE'
|
95
|
+
FEMALE = 'FEMALE'
|
96
|
+
end
|
97
|
+
|
98
|
+
class Case < BaseEnum
|
99
|
+
UPPER = 'upper'
|
100
|
+
LOWER = 'lower'
|
101
|
+
UNCHANGED = ''
|
102
|
+
end
|
103
|
+
|
104
|
+
class LineEnding < BaseEnum
|
105
|
+
UNIX = 'UNIX'
|
106
|
+
WINDOWS = 'WINDOWS'
|
107
|
+
OSX = 'OSX'
|
108
|
+
end
|
109
|
+
|
110
|
+
class CustomerApprovalStep < BaseEnum
|
111
|
+
TRANSLATION = 'TRANSLATION'
|
112
|
+
RETURN = 'RETURN'
|
113
|
+
end
|
114
|
+
|
115
|
+
class CustomerApprovalTool < BaseEnum
|
116
|
+
AMARA = 'AMARA'
|
117
|
+
CIELO24 = 'CIELO24'
|
118
|
+
end
|
119
|
+
|
120
|
+
class Language < BaseEnum
|
121
|
+
ENGLISH = 'en'
|
122
|
+
FRENCH = 'fr'
|
123
|
+
SPANISH = 'es'
|
124
|
+
GERMAN = 'de'
|
125
|
+
MANDARIN_CHINESE = 'cmn'
|
126
|
+
PORTUGUESE = 'pt'
|
127
|
+
JAPANESE = 'jp'
|
128
|
+
ARABIC = 'ar'
|
129
|
+
KOREAN = 'ko'
|
130
|
+
TRADITIONAL_CHINESE = 'zh'
|
131
|
+
HINDI = 'hi'
|
132
|
+
ITALIAN = 'it'
|
133
|
+
RUSSIAN = 'ru'
|
134
|
+
TURKISH = 'tr'
|
135
|
+
HEBREW = 'he'
|
136
|
+
end
|
137
|
+
|
138
|
+
class IWP < BaseEnum
|
139
|
+
PREMIUM = 'PREMIUM'
|
140
|
+
INTERIM_PROFESSIONAL = 'INTERIM_PROFESSIONAL'
|
141
|
+
PROFESSIONAL = 'PROFESSIONAL'
|
142
|
+
SPEAKER_ID = 'SPEAKER_ID'
|
143
|
+
FINAL = 'FINAL'
|
144
|
+
MECHANICAL = 'MECHANICAL'
|
145
|
+
CUSTOMER_APPROVED_RETURN = 'CUSTOMER_APPROVED_RETURN'
|
146
|
+
CUSTOMER_APPROVED_TRANSLATION = 'CUSTOMER_APPROVED_TRANSLATION'
|
147
|
+
end
|
148
|
+
|
149
|
+
class JobDifficulty < BaseEnum
|
150
|
+
GOOD = 'Good'
|
151
|
+
BAD = 'Bad'
|
152
|
+
UNKNOWN = 'Unknown'
|
153
|
+
end
|
154
154
|
end
|
data/lib/cielo24/options.rb
CHANGED
@@ -1,220 +1,220 @@
|
|
1
|
-
module Cielo24
|
2
|
-
class BaseOptions
|
3
|
-
|
4
|
-
def get_hash
|
5
|
-
hash = {}
|
6
|
-
self.instance_variables.each{ |var|
|
7
|
-
value = self.instance_variable_get(var)
|
8
|
-
unless value.nil?
|
9
|
-
hash[var.to_s.delete('@')] = value
|
10
|
-
end
|
11
|
-
}
|
12
|
-
return hash
|
13
|
-
end
|
14
|
-
|
15
|
-
def to_query
|
16
|
-
hash = get_hash
|
17
|
-
array = Array.new
|
18
|
-
hash.each do |key, value|
|
19
|
-
array.push(key + '=' + value.to_s)
|
20
|
-
end
|
21
|
-
return array.join('&')
|
22
|
-
end
|
23
|
-
|
24
|
-
def populate_from_key_value_pair(key, value)
|
25
|
-
# Iterate over instance variables
|
26
|
-
self.instance_variables.each{ |var|
|
27
|
-
# key gets converted to_s because it can be a Symbol
|
28
|
-
if var.to_s.delete('@') == key.to_s
|
29
|
-
self.instance_variable_set(var, value)
|
30
|
-
break
|
31
|
-
end
|
32
|
-
}
|
33
|
-
end
|
34
|
-
|
35
|
-
def populate_from_hash(hash)
|
36
|
-
unless hash.nil?
|
37
|
-
hash.each do |key, value|
|
38
|
-
populate_from_key_value_pair(key, value)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
class CommonOptions < BaseOptions
|
45
|
-
|
46
|
-
attr_accessor :elementlist_version
|
47
|
-
attr_accessor :emit_speaker_change_token_as
|
48
|
-
attr_accessor :mask_profanity
|
49
|
-
attr_accessor :remove_disfluencies
|
50
|
-
attr_accessor :remove_sounds_list
|
51
|
-
attr_accessor :remove_sound_references
|
52
|
-
attr_accessor :replace_slang
|
53
|
-
attr_accessor :sound_boundaries
|
54
|
-
|
55
|
-
def initialize
|
56
|
-
@elementlist_version = nil
|
57
|
-
@emit_speaker_change_token_as = nil
|
58
|
-
@mask_profanity = nil
|
59
|
-
@remove_disfluencies = nil
|
60
|
-
@remove_sounds_list = nil
|
61
|
-
@remove_sound_references = nil
|
62
|
-
@replace_slang = nil
|
63
|
-
@sound_boundaries = nil
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
class TranscriptOptions < CommonOptions
|
68
|
-
|
69
|
-
attr_accessor :create_paragraphs
|
70
|
-
attr_accessor :newlines_after_paragraph
|
71
|
-
attr_accessor :newlines_after_sentence
|
72
|
-
attr_accessor :timecode_every_paragraph
|
73
|
-
attr_accessor :timecode_format
|
74
|
-
attr_accessor :timecode_interval
|
75
|
-
attr_accessor :timecode_offset
|
76
|
-
|
77
|
-
def initialize(option_hash={})
|
78
|
-
@create_paragraphs = nil
|
79
|
-
@newlines_after_paragraph = nil
|
80
|
-
@newlines_after_sentence = nil
|
81
|
-
@timecode_every_paragraph = nil
|
82
|
-
@timecode_format = nil
|
83
|
-
@timecode_interval = nil
|
84
|
-
@timecode_offset = nil
|
85
|
-
populate_from_hash(option_hash)
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
class CaptionOptions < CommonOptions
|
90
|
-
|
91
|
-
attr_accessor :build_url
|
92
|
-
attr_accessor :caption_words_min
|
93
|
-
attr_accessor :caption_by_sentence
|
94
|
-
attr_accessor :characters_per_caption_line
|
95
|
-
attr_accessor :dfxp_header
|
96
|
-
attr_accessor :disallow_dangling
|
97
|
-
attr_accessor :display_effects_speaker_as
|
98
|
-
attr_accessor :display_speaker_id
|
99
|
-
attr_accessor :force_case
|
100
|
-
attr_accessor :include_dfxp_metadata
|
101
|
-
attr_accessor :layout_target_caption_length_ms
|
102
|
-
attr_accessor :line_break_on_sentence
|
103
|
-
attr_accessor :line_ending_format
|
104
|
-
attr_accessor :lines_per_caption
|
105
|
-
attr_accessor :maximum_caption_duration
|
106
|
-
attr_accessor :merge_gap_interval
|
107
|
-
attr_accessor :minimum_caption_length_ms
|
108
|
-
attr_accessor :minimum_gap_between_captions_ms
|
109
|
-
attr_accessor :qt_seamless
|
110
|
-
attr_accessor :silence_max_ms
|
111
|
-
attr_accessor :single_speaker_per_caption
|
112
|
-
attr_accessor :sound_threshold
|
113
|
-
attr_accessor :sound_tokens_by_caption
|
114
|
-
attr_accessor :sound_tokens_by_line
|
115
|
-
attr_accessor :sound_tokens_by_caption_list
|
116
|
-
attr_accessor :sound_tokens_by_line_list
|
117
|
-
attr_accessor :speaker_on_new_line
|
118
|
-
attr_accessor :srt_format
|
119
|
-
attr_accessor :strip_square_brackets
|
120
|
-
attr_accessor :utf8_mark
|
121
|
-
|
122
|
-
def initialize(option_hash={})
|
123
|
-
@build_url = nil
|
124
|
-
@caption_words_min = nil
|
125
|
-
@caption_by_sentence = nil
|
126
|
-
@characters_per_caption_line = nil
|
127
|
-
@dfxp_header = nil
|
128
|
-
@disallow_dangling = nil
|
129
|
-
@display_effects_speaker_as = nil
|
130
|
-
@display_speaker_id = nil
|
131
|
-
@force_case = nil
|
132
|
-
@include_dfxp_metadata = nil
|
133
|
-
@layout_target_caption_length_ms = nil
|
134
|
-
@line_break_on_sentence = nil
|
135
|
-
@line_ending_format = nil
|
136
|
-
@lines_per_caption = nil
|
137
|
-
@maximum_caption_duration = nil
|
138
|
-
@merge_gap_interval = nil
|
139
|
-
@minimum_caption_length_ms = nil
|
140
|
-
@minimum_gap_between_captions_ms = nil
|
141
|
-
@qt_seamless = nil
|
142
|
-
@silence_max_ms = nil
|
143
|
-
@single_speaker_per_caption = nil
|
144
|
-
@sound_threshold = nil
|
145
|
-
@sound_tokens_by_caption = nil
|
146
|
-
@sound_tokens_by_line = nil
|
147
|
-
@sound_tokens_by_caption_list = nil
|
148
|
-
@sound_tokens_by_line_list = nil
|
149
|
-
@speaker_on_new_line = nil
|
150
|
-
@srt_format = nil
|
151
|
-
@strip_square_brackets = nil
|
152
|
-
@utf8_mark = nil
|
153
|
-
populate_from_hash(option_hash)
|
154
|
-
end
|
155
|
-
end
|
156
|
-
|
157
|
-
class PerformTranscriptionOptions < BaseOptions
|
158
|
-
|
159
|
-
attr_accessor :customer_approval_steps
|
160
|
-
attr_accessor :customer_approval_tool
|
161
|
-
attr_accessor :custom_metadata
|
162
|
-
attr_accessor :generate_media_intelligence_for_iwp
|
163
|
-
attr_accessor :notes
|
164
|
-
attr_accessor :return_iwp
|
165
|
-
attr_accessor :speaker_id
|
166
|
-
|
167
|
-
def initialize(option_hash={})
|
168
|
-
@customer_approval_steps = nil
|
169
|
-
@customer_approval_tool = nil
|
170
|
-
@custom_metadata = nil
|
171
|
-
@generate_media_intelligence_for_iwp = nil
|
172
|
-
@notes = nil
|
173
|
-
@return_iwp = nil
|
174
|
-
@speaker_id = nil
|
175
|
-
populate_from_hash(option_hash)
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
class JobListOptions < BaseOptions
|
180
|
-
|
181
|
-
attr_accessor :CreationDateFrom
|
182
|
-
attr_accessor :CreationDateTo
|
183
|
-
attr_accessor :StartDateFrom
|
184
|
-
attr_accessor :StartDateTo
|
185
|
-
attr_accessor :DueDateFrom
|
186
|
-
attr_accessor :DueDateTo
|
187
|
-
attr_accessor :CompleteDateFrom
|
188
|
-
attr_accessor :CompleteDateTo
|
189
|
-
attr_accessor :JobStatus
|
190
|
-
attr_accessor :Fidelity
|
191
|
-
attr_accessor :Priority
|
192
|
-
attr_accessor :TurnaroundTimeHoursFrom
|
193
|
-
attr_accessor :TurnaroundTimeHoursTo
|
194
|
-
attr_accessor :JobName
|
195
|
-
attr_accessor :ExternalId
|
196
|
-
attr_accessor :JobDifficulty
|
197
|
-
attr_accessor :Username
|
198
|
-
|
199
|
-
def initialize(option_hash={})
|
200
|
-
@CreationDateFrom = nil
|
201
|
-
@CreationDateTo = nil
|
202
|
-
@StartDateFrom = nil
|
203
|
-
@StartDateTo = nil
|
204
|
-
@DueDateFrom = nil
|
205
|
-
@DueDateTo = nil
|
206
|
-
@CompleteDateFrom = nil
|
207
|
-
@CompleteDateTo = nil
|
208
|
-
@JobStatus = nil
|
209
|
-
@Fidelity = nil
|
210
|
-
@Priority = nil
|
211
|
-
@TurnaroundTimeHoursFrom = nil
|
212
|
-
@TurnaroundTimeHoursTo = nil
|
213
|
-
@JobName = nil
|
214
|
-
@ExternalId = nil
|
215
|
-
@JobDifficulty = nil
|
216
|
-
@Username = nil
|
217
|
-
populate_from_hash(option_hash)
|
218
|
-
end
|
219
|
-
end
|
1
|
+
module Cielo24
|
2
|
+
class BaseOptions
|
3
|
+
|
4
|
+
def get_hash
|
5
|
+
hash = {}
|
6
|
+
self.instance_variables.each{ |var|
|
7
|
+
value = self.instance_variable_get(var)
|
8
|
+
unless value.nil?
|
9
|
+
hash[var.to_s.delete('@')] = value
|
10
|
+
end
|
11
|
+
}
|
12
|
+
return hash
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_query
|
16
|
+
hash = get_hash
|
17
|
+
array = Array.new
|
18
|
+
hash.each do |key, value|
|
19
|
+
array.push(key + '=' + value.to_s)
|
20
|
+
end
|
21
|
+
return array.join('&')
|
22
|
+
end
|
23
|
+
|
24
|
+
def populate_from_key_value_pair(key, value)
|
25
|
+
# Iterate over instance variables
|
26
|
+
self.instance_variables.each{ |var|
|
27
|
+
# key gets converted to_s because it can be a Symbol
|
28
|
+
if var.to_s.delete('@') == key.to_s
|
29
|
+
self.instance_variable_set(var, value)
|
30
|
+
break
|
31
|
+
end
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
def populate_from_hash(hash)
|
36
|
+
unless hash.nil?
|
37
|
+
hash.each do |key, value|
|
38
|
+
populate_from_key_value_pair(key, value)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class CommonOptions < BaseOptions
|
45
|
+
|
46
|
+
attr_accessor :elementlist_version
|
47
|
+
attr_accessor :emit_speaker_change_token_as
|
48
|
+
attr_accessor :mask_profanity
|
49
|
+
attr_accessor :remove_disfluencies
|
50
|
+
attr_accessor :remove_sounds_list
|
51
|
+
attr_accessor :remove_sound_references
|
52
|
+
attr_accessor :replace_slang
|
53
|
+
attr_accessor :sound_boundaries
|
54
|
+
|
55
|
+
def initialize
|
56
|
+
@elementlist_version = nil
|
57
|
+
@emit_speaker_change_token_as = nil
|
58
|
+
@mask_profanity = nil
|
59
|
+
@remove_disfluencies = nil
|
60
|
+
@remove_sounds_list = nil
|
61
|
+
@remove_sound_references = nil
|
62
|
+
@replace_slang = nil
|
63
|
+
@sound_boundaries = nil
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
class TranscriptOptions < CommonOptions
|
68
|
+
|
69
|
+
attr_accessor :create_paragraphs
|
70
|
+
attr_accessor :newlines_after_paragraph
|
71
|
+
attr_accessor :newlines_after_sentence
|
72
|
+
attr_accessor :timecode_every_paragraph
|
73
|
+
attr_accessor :timecode_format
|
74
|
+
attr_accessor :timecode_interval
|
75
|
+
attr_accessor :timecode_offset
|
76
|
+
|
77
|
+
def initialize(option_hash={})
|
78
|
+
@create_paragraphs = nil
|
79
|
+
@newlines_after_paragraph = nil
|
80
|
+
@newlines_after_sentence = nil
|
81
|
+
@timecode_every_paragraph = nil
|
82
|
+
@timecode_format = nil
|
83
|
+
@timecode_interval = nil
|
84
|
+
@timecode_offset = nil
|
85
|
+
populate_from_hash(option_hash)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
class CaptionOptions < CommonOptions
|
90
|
+
|
91
|
+
attr_accessor :build_url
|
92
|
+
attr_accessor :caption_words_min
|
93
|
+
attr_accessor :caption_by_sentence
|
94
|
+
attr_accessor :characters_per_caption_line
|
95
|
+
attr_accessor :dfxp_header
|
96
|
+
attr_accessor :disallow_dangling
|
97
|
+
attr_accessor :display_effects_speaker_as
|
98
|
+
attr_accessor :display_speaker_id
|
99
|
+
attr_accessor :force_case
|
100
|
+
attr_accessor :include_dfxp_metadata
|
101
|
+
attr_accessor :layout_target_caption_length_ms
|
102
|
+
attr_accessor :line_break_on_sentence
|
103
|
+
attr_accessor :line_ending_format
|
104
|
+
attr_accessor :lines_per_caption
|
105
|
+
attr_accessor :maximum_caption_duration
|
106
|
+
attr_accessor :merge_gap_interval
|
107
|
+
attr_accessor :minimum_caption_length_ms
|
108
|
+
attr_accessor :minimum_gap_between_captions_ms
|
109
|
+
attr_accessor :qt_seamless
|
110
|
+
attr_accessor :silence_max_ms
|
111
|
+
attr_accessor :single_speaker_per_caption
|
112
|
+
attr_accessor :sound_threshold
|
113
|
+
attr_accessor :sound_tokens_by_caption
|
114
|
+
attr_accessor :sound_tokens_by_line
|
115
|
+
attr_accessor :sound_tokens_by_caption_list
|
116
|
+
attr_accessor :sound_tokens_by_line_list
|
117
|
+
attr_accessor :speaker_on_new_line
|
118
|
+
attr_accessor :srt_format
|
119
|
+
attr_accessor :strip_square_brackets
|
120
|
+
attr_accessor :utf8_mark
|
121
|
+
|
122
|
+
def initialize(option_hash={})
|
123
|
+
@build_url = nil
|
124
|
+
@caption_words_min = nil
|
125
|
+
@caption_by_sentence = nil
|
126
|
+
@characters_per_caption_line = nil
|
127
|
+
@dfxp_header = nil
|
128
|
+
@disallow_dangling = nil
|
129
|
+
@display_effects_speaker_as = nil
|
130
|
+
@display_speaker_id = nil
|
131
|
+
@force_case = nil
|
132
|
+
@include_dfxp_metadata = nil
|
133
|
+
@layout_target_caption_length_ms = nil
|
134
|
+
@line_break_on_sentence = nil
|
135
|
+
@line_ending_format = nil
|
136
|
+
@lines_per_caption = nil
|
137
|
+
@maximum_caption_duration = nil
|
138
|
+
@merge_gap_interval = nil
|
139
|
+
@minimum_caption_length_ms = nil
|
140
|
+
@minimum_gap_between_captions_ms = nil
|
141
|
+
@qt_seamless = nil
|
142
|
+
@silence_max_ms = nil
|
143
|
+
@single_speaker_per_caption = nil
|
144
|
+
@sound_threshold = nil
|
145
|
+
@sound_tokens_by_caption = nil
|
146
|
+
@sound_tokens_by_line = nil
|
147
|
+
@sound_tokens_by_caption_list = nil
|
148
|
+
@sound_tokens_by_line_list = nil
|
149
|
+
@speaker_on_new_line = nil
|
150
|
+
@srt_format = nil
|
151
|
+
@strip_square_brackets = nil
|
152
|
+
@utf8_mark = nil
|
153
|
+
populate_from_hash(option_hash)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
class PerformTranscriptionOptions < BaseOptions
|
158
|
+
|
159
|
+
attr_accessor :customer_approval_steps
|
160
|
+
attr_accessor :customer_approval_tool
|
161
|
+
attr_accessor :custom_metadata
|
162
|
+
attr_accessor :generate_media_intelligence_for_iwp
|
163
|
+
attr_accessor :notes
|
164
|
+
attr_accessor :return_iwp
|
165
|
+
attr_accessor :speaker_id
|
166
|
+
|
167
|
+
def initialize(option_hash={})
|
168
|
+
@customer_approval_steps = nil
|
169
|
+
@customer_approval_tool = nil
|
170
|
+
@custom_metadata = nil
|
171
|
+
@generate_media_intelligence_for_iwp = nil
|
172
|
+
@notes = nil
|
173
|
+
@return_iwp = nil
|
174
|
+
@speaker_id = nil
|
175
|
+
populate_from_hash(option_hash)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
class JobListOptions < BaseOptions
|
180
|
+
|
181
|
+
attr_accessor :CreationDateFrom
|
182
|
+
attr_accessor :CreationDateTo
|
183
|
+
attr_accessor :StartDateFrom
|
184
|
+
attr_accessor :StartDateTo
|
185
|
+
attr_accessor :DueDateFrom
|
186
|
+
attr_accessor :DueDateTo
|
187
|
+
attr_accessor :CompleteDateFrom
|
188
|
+
attr_accessor :CompleteDateTo
|
189
|
+
attr_accessor :JobStatus
|
190
|
+
attr_accessor :Fidelity
|
191
|
+
attr_accessor :Priority
|
192
|
+
attr_accessor :TurnaroundTimeHoursFrom
|
193
|
+
attr_accessor :TurnaroundTimeHoursTo
|
194
|
+
attr_accessor :JobName
|
195
|
+
attr_accessor :ExternalId
|
196
|
+
attr_accessor :JobDifficulty
|
197
|
+
attr_accessor :Username
|
198
|
+
|
199
|
+
def initialize(option_hash={})
|
200
|
+
@CreationDateFrom = nil
|
201
|
+
@CreationDateTo = nil
|
202
|
+
@StartDateFrom = nil
|
203
|
+
@StartDateTo = nil
|
204
|
+
@DueDateFrom = nil
|
205
|
+
@DueDateTo = nil
|
206
|
+
@CompleteDateFrom = nil
|
207
|
+
@CompleteDateTo = nil
|
208
|
+
@JobStatus = nil
|
209
|
+
@Fidelity = nil
|
210
|
+
@Priority = nil
|
211
|
+
@TurnaroundTimeHoursFrom = nil
|
212
|
+
@TurnaroundTimeHoursTo = nil
|
213
|
+
@JobName = nil
|
214
|
+
@ExternalId = nil
|
215
|
+
@JobDifficulty = nil
|
216
|
+
@Username = nil
|
217
|
+
populate_from_hash(option_hash)
|
218
|
+
end
|
219
|
+
end
|
220
220
|
end
|