tencentcloud-sdk-hcm 1.0.200
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/VERSION +1 -0
- data/lib/tencentcloud-sdk-hcm.rb +11 -0
- data/lib/v20181106/client.rb +60 -0
- data/lib/v20181106/models.rb +197 -0
- metadata +66 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 248c622f8b5051048c5f750fb7a6d1f0c40c955a
|
4
|
+
data.tar.gz: 75114d89f6e330d81d5d47ebc479b02e7ed33e76
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a3c4ea7adf03e740fc8c34d38172a6aa034b41cdda79720e29168c64ddee0df288b2f39cb8d925fe60982b87d8fafa0b914c01b0dacf2562fd2ec0e451c09dd0
|
7
|
+
data.tar.gz: 9972b105ba02b073ec466c66217d8f1bf50dc2de3b4715174d9e5b35f7cac4380148d35d242fe089fa669b8186c7c00b32282439480631e0aebe9146b5ff04ef
|
data/lib/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.200
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require 'json'
|
18
|
+
|
19
|
+
module TencentCloud
|
20
|
+
module Hcm
|
21
|
+
module V20181106
|
22
|
+
class Client < TencentCloud::Common::AbstractClient
|
23
|
+
|
24
|
+
def initialize(credential, region, profile = nil)
|
25
|
+
api_version = '2018-11-06'
|
26
|
+
api_endpoint = 'hcm.tencentcloudapi.com'
|
27
|
+
sdk_version = 'HCM_' + File.read(File.expand_path('../VERSION', __dir__)).strip
|
28
|
+
super(credential, region, api_version, api_endpoint, sdk_version, profile)
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
# 速算题目批改接口,根据用户上传的图片或图片的URL识别图片中的数学算式,进而给出算式的正确性评估。
|
33
|
+
|
34
|
+
# @param request: Request instance for Evaluation.
|
35
|
+
# @type request: :class:`Tencentcloud::hcm::V20181106::EvaluationRequest`
|
36
|
+
# @rtype: :class:`Tencentcloud::hcm::V20181106::EvaluationResponse`
|
37
|
+
def Evaluation(request)
|
38
|
+
body = send_request('Evaluation', request.serialize)
|
39
|
+
response = JSON.parse(body)
|
40
|
+
if response['Response'].key?('Error') == false
|
41
|
+
model = EvaluationResponse.new
|
42
|
+
model.deserialize(response['Response'])
|
43
|
+
model
|
44
|
+
else
|
45
|
+
code = response['Response']['Error']['Code']
|
46
|
+
message = response['Response']['Error']['Message']
|
47
|
+
reqid = response['Response']['RequestId']
|
48
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
49
|
+
end
|
50
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
51
|
+
raise e
|
52
|
+
rescue StandardError => e
|
53
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,197 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
module TencentCloud
|
18
|
+
module Hcm
|
19
|
+
module V20181106
|
20
|
+
# Evaluation请求参数结构体
|
21
|
+
class EvaluationRequest < TencentCloud::Common::AbstractModel
|
22
|
+
# @param SessionId: 图片唯一标识,一张图片一个SessionId;
|
23
|
+
# @type SessionId: String
|
24
|
+
# @param Image: 图片数据,需要使用base64对图片的二进制数据进行编码,与url参数二者填一即可;
|
25
|
+
# @type Image: String
|
26
|
+
# @param HcmAppid: 业务应用ID,与账号应用APPID无关,是用来方便客户管理服务的参数,新的 HcmAppid 可以在[控制台](https://console.cloud.tencent.com/hcm)【应用管理】下新建。
|
27
|
+
# @type HcmAppid: String
|
28
|
+
# @param Url: 图片url,与Image参数二者填一即可;
|
29
|
+
# @type Url: String
|
30
|
+
# @param SupportHorizontalImage: 横屏拍摄开关,若开启则支持传输横屏拍摄的图片;
|
31
|
+
# @type SupportHorizontalImage: Boolean
|
32
|
+
# @param RejectNonArithmeticImage: 拒绝非速算图(如风景图、人物图)开关,若开启,则遇到非速算图会快速返回拒绝的结果,但极端情况下可能会影响评估结果(比如算式截图贴到风景画里可能被判为非速算图直接返回了)。
|
33
|
+
# @type RejectNonArithmeticImage: Boolean
|
34
|
+
# @param IsAsync: 异步模式标识,0:同步模式,1:异步模式。默认为同步模式
|
35
|
+
# @type IsAsync: Integer
|
36
|
+
# @param EnableDispRelatedVertical: 是否展开耦合算式中的竖式计算
|
37
|
+
# @type EnableDispRelatedVertical: Boolean
|
38
|
+
# @param EnableDispMidresult: 是否展示竖式算式的中间结果和格式控制字符
|
39
|
+
# @type EnableDispMidresult: Boolean
|
40
|
+
# @param EnablePdfRecognize: 是否开启pdf识别,默认开启
|
41
|
+
# @type EnablePdfRecognize: Boolean
|
42
|
+
# @param PdfPageIndex: pdf页码,从0开始,默认为0
|
43
|
+
# @type PdfPageIndex: Integer
|
44
|
+
# @param LaTex: 是否返回LaTex,默认为0返回普通格式,设置成1返回LaTex格式
|
45
|
+
# @type LaTex: Integer
|
46
|
+
# @param RejectVagueArithmetic: 用于选择是否拒绝模糊题 目。打开则丢弃模糊题目, 不进行后续的判题返回结 果。
|
47
|
+
# @type RejectVagueArithmetic: Boolean
|
48
|
+
|
49
|
+
attr_accessor :SessionId, :Image, :HcmAppid, :Url, :SupportHorizontalImage, :RejectNonArithmeticImage, :IsAsync, :EnableDispRelatedVertical, :EnableDispMidresult, :EnablePdfRecognize, :PdfPageIndex, :LaTex, :RejectVagueArithmetic
|
50
|
+
|
51
|
+
def initialize(sessionid=nil, image=nil, hcmappid=nil, url=nil, supporthorizontalimage=nil, rejectnonarithmeticimage=nil, isasync=nil, enabledisprelatedvertical=nil, enabledispmidresult=nil, enablepdfrecognize=nil, pdfpageindex=nil, latex=nil, rejectvaguearithmetic=nil)
|
52
|
+
@SessionId = sessionid
|
53
|
+
@Image = image
|
54
|
+
@HcmAppid = hcmappid
|
55
|
+
@Url = url
|
56
|
+
@SupportHorizontalImage = supporthorizontalimage
|
57
|
+
@RejectNonArithmeticImage = rejectnonarithmeticimage
|
58
|
+
@IsAsync = isasync
|
59
|
+
@EnableDispRelatedVertical = enabledisprelatedvertical
|
60
|
+
@EnableDispMidresult = enabledispmidresult
|
61
|
+
@EnablePdfRecognize = enablepdfrecognize
|
62
|
+
@PdfPageIndex = pdfpageindex
|
63
|
+
@LaTex = latex
|
64
|
+
@RejectVagueArithmetic = rejectvaguearithmetic
|
65
|
+
end
|
66
|
+
|
67
|
+
def deserialize(params)
|
68
|
+
@SessionId = params['SessionId']
|
69
|
+
@Image = params['Image']
|
70
|
+
@HcmAppid = params['HcmAppid']
|
71
|
+
@Url = params['Url']
|
72
|
+
@SupportHorizontalImage = params['SupportHorizontalImage']
|
73
|
+
@RejectNonArithmeticImage = params['RejectNonArithmeticImage']
|
74
|
+
@IsAsync = params['IsAsync']
|
75
|
+
@EnableDispRelatedVertical = params['EnableDispRelatedVertical']
|
76
|
+
@EnableDispMidresult = params['EnableDispMidresult']
|
77
|
+
@EnablePdfRecognize = params['EnablePdfRecognize']
|
78
|
+
@PdfPageIndex = params['PdfPageIndex']
|
79
|
+
@LaTex = params['LaTex']
|
80
|
+
@RejectVagueArithmetic = params['RejectVagueArithmetic']
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Evaluation返回参数结构体
|
85
|
+
class EvaluationResponse < TencentCloud::Common::AbstractModel
|
86
|
+
# @param SessionId: 图片唯一标识,一张图片一个SessionId;
|
87
|
+
# @type SessionId: String
|
88
|
+
# @param Items: 识别出的算式信息;
|
89
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
90
|
+
# @type Items: Array
|
91
|
+
# @param TaskId: 任务 id,用于查询接口
|
92
|
+
# @type TaskId: String
|
93
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
94
|
+
# @type RequestId: String
|
95
|
+
|
96
|
+
attr_accessor :SessionId, :Items, :TaskId, :RequestId
|
97
|
+
|
98
|
+
def initialize(sessionid=nil, items=nil, taskid=nil, requestid=nil)
|
99
|
+
@SessionId = sessionid
|
100
|
+
@Items = items
|
101
|
+
@TaskId = taskid
|
102
|
+
@RequestId = requestid
|
103
|
+
end
|
104
|
+
|
105
|
+
def deserialize(params)
|
106
|
+
@SessionId = params['SessionId']
|
107
|
+
unless params['Items'].nil?
|
108
|
+
@Items = []
|
109
|
+
params['Items'].each do |i|
|
110
|
+
item_tmp = Item.new
|
111
|
+
item_tmp.deserialize(i)
|
112
|
+
@Items << item_tmp
|
113
|
+
end
|
114
|
+
end
|
115
|
+
@TaskId = params['TaskId']
|
116
|
+
@RequestId = params['RequestId']
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
# 识别出的算术式信息及评估结果
|
121
|
+
class Item < TencentCloud::Common::AbstractModel
|
122
|
+
# @param Item: 识别的算式是否正确,算式运算结果: ‘YES’:正确 ‘NO’: 错误 ‘NA’: 非法参数
|
123
|
+
# @type Item: String
|
124
|
+
# @param ItemString: 识别出的算式,识别出的文本行字符串
|
125
|
+
# @type ItemString: String
|
126
|
+
# @param ItemCoord: 识别的算式在图片上的位置信息,文本行在旋转纠正之后的图像中的像素坐 标,表示为(左上角 x, 左上角 y,宽 width, 高 height)
|
127
|
+
# @type ItemCoord: :class:`Tencentcloud::Hcm.v20181106.models.ItemCoord`
|
128
|
+
# @param Answer: 错题推荐答案,算式运算结果正确返回为 "",算式运算结果错误返回推荐答案 (注:暂不支持多个关系运算符(如 1<10<7)、 无关系运算符(如 frac(1,2)+frac(2,3))、单 位换算(如 1 元=100 角)错题的推荐答案 返回)
|
129
|
+
# @type Answer: String
|
130
|
+
# @param ExpressionType: 算式题型编号,如加减乘除四则题型,具体题型及编号如下:1 加减乘除四则 2 加减乘除已知结果求运算因子3 判断大小 4 约等于估算 5 带余数除法 6 分数四则运算 7 单位换算 8 竖式加减法 9 竖式乘除法 10 脱式计算 11 解方程
|
131
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
132
|
+
# @type ExpressionType: String
|
133
|
+
# @param ItemConf: 文本行置信度
|
134
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
135
|
+
# @type ItemConf: Float
|
136
|
+
# @param QuestionId: 用于标识题目 id,如果有若干算式属于同一 题,则其对应的 id 相同。
|
137
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
138
|
+
# @type QuestionId: String
|
139
|
+
|
140
|
+
attr_accessor :Item, :ItemString, :ItemCoord, :Answer, :ExpressionType, :ItemConf, :QuestionId
|
141
|
+
|
142
|
+
def initialize(item=nil, itemstring=nil, itemcoord=nil, answer=nil, expressiontype=nil, itemconf=nil, questionid=nil)
|
143
|
+
@Item = item
|
144
|
+
@ItemString = itemstring
|
145
|
+
@ItemCoord = itemcoord
|
146
|
+
@Answer = answer
|
147
|
+
@ExpressionType = expressiontype
|
148
|
+
@ItemConf = itemconf
|
149
|
+
@QuestionId = questionid
|
150
|
+
end
|
151
|
+
|
152
|
+
def deserialize(params)
|
153
|
+
@Item = params['Item']
|
154
|
+
@ItemString = params['ItemString']
|
155
|
+
unless params['ItemCoord'].nil?
|
156
|
+
@ItemCoord = ItemCoord.new
|
157
|
+
@ItemCoord.deserialize(params['ItemCoord'])
|
158
|
+
end
|
159
|
+
@Answer = params['Answer']
|
160
|
+
@ExpressionType = params['ExpressionType']
|
161
|
+
@ItemConf = params['ItemConf']
|
162
|
+
@QuestionId = params['QuestionId']
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# 目标算式在图片上的坐标信息
|
167
|
+
class ItemCoord < TencentCloud::Common::AbstractModel
|
168
|
+
# @param Height: 算式高度
|
169
|
+
# @type Height: Integer
|
170
|
+
# @param Width: 算式宽度
|
171
|
+
# @type Width: Integer
|
172
|
+
# @param X: 算式图的左上角横坐标
|
173
|
+
# @type X: Integer
|
174
|
+
# @param Y: 算式图的左上角纵坐标
|
175
|
+
# @type Y: Integer
|
176
|
+
|
177
|
+
attr_accessor :Height, :Width, :X, :Y
|
178
|
+
|
179
|
+
def initialize(height=nil, width=nil, x=nil, y=nil)
|
180
|
+
@Height = height
|
181
|
+
@Width = width
|
182
|
+
@X = x
|
183
|
+
@Y = y
|
184
|
+
end
|
185
|
+
|
186
|
+
def deserialize(params)
|
187
|
+
@Height = params['Height']
|
188
|
+
@Width = params['Width']
|
189
|
+
@X = params['X']
|
190
|
+
@Y = params['Y']
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
metadata
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tencentcloud-sdk-hcm
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.200
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tencent Cloud
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-11-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: tencentcloud-sdk-common
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
description: Tencent Cloud Ruby SDK is the official software development kit, which
|
28
|
+
allows Ruby developers to write software that makes use of Tencent Cloud service
|
29
|
+
HCM.
|
30
|
+
email:
|
31
|
+
- tencentcloudapi@tencent.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- lib/VERSION
|
37
|
+
- lib/tencentcloud-sdk-hcm.rb
|
38
|
+
- lib/v20181106/client.rb
|
39
|
+
- lib/v20181106/models.rb
|
40
|
+
homepage: https://github.com/TencentCloud/tencentcloud-sdk-ruby
|
41
|
+
licenses:
|
42
|
+
- Apache-2.0
|
43
|
+
metadata:
|
44
|
+
source_code_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/tencentcloud-sdk-hcm
|
45
|
+
changelog_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/blob/master/CHANGELOG.md
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options: []
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
requirements: []
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 2.6.14
|
63
|
+
signing_key:
|
64
|
+
specification_version: 4
|
65
|
+
summary: Tencent Cloud SDK for Ruby - HCM
|
66
|
+
test_files: []
|