ruku_opera.py 105 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  1. # -*- coding:utf-8 -*-
  2. import random, hashlib
  3. import requests
  4. import configs
  5. import shutil
  6. from utils.diffi_label import get_item_diff
  7. from utils.img2latex import get_ocrlatex_by_url
  8. from utils.qcloud_bucket import upload_img_to_qcloud, img_inbucket_count, client, filestream_upload
  9. from concurrent.futures import ProcessPoolExecutor
  10. from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
  11. from utils.image_convert import svg2png
  12. from utils.label_data_Hphy import Label
  13. from bisect import bisect_left
  14. import re, time, os, json, datetime
  15. from copy import deepcopy
  16. logger = configs.myLog(__name__, log_cate="ruku_log").getlog()
  17. subject_id = {
  18. "高中数学": 3,
  19. "高中英语": 8,
  20. "高中物理": 12,
  21. "高中化学": 13,
  22. "高中生物": 14,
  23. "高中政治": 15,
  24. "高中历史": 16,
  25. "高中地理": 17,
  26. "初中数学": 41,
  27. "初中英语": 42,
  28. "初中物理": 43,
  29. "初中化学": 44,
  30. "初中生物": 45,
  31. "初中地理": 46,
  32. "初中政治": 47,
  33. "初中历史": 48,
  34. "高中语文": 9,
  35. "初中语文": 40,
  36. }
  37. class Ruku():
  38. def __init__(self, items_list, htmlt, svg_data, wordid, callback_info, subject=""):
  39. self.items_list = items_list
  40. self.htmlt = htmlt
  41. self.svg_data = svg_data
  42. self.wordid = wordid
  43. self.callback_url = callback_info["callback_url"]
  44. # self.callback_url = "123456"
  45. self.source = callback_info["source"]
  46. self.subject = subject # items_list[0]["period"] + items_list[0]["subject"]
  47. self.callback_code = 0
  48. self.callback_err = ""
  49. self.ltx2url = {} # latex 映射 线上可访问url
  50. def bucket_img_del(self):
  51. """
  52. wordbin中图片上传腾讯云的原因:1.存在线上服务器的图片要定期删除,而有的题可能还没审核完;2.上传腾讯云比较便宜
  53. 删除腾讯云中的图片
  54. 根据【解析结果】文本中删除的图片信息,通过阙值判断是否从腾讯云中删除图片
  55. 也有限制:解析结果不能为空,结果中出现的图片在原试卷应该也要有!
  56. 有风险:对于已经校对过的试卷,如果后期有人在资源库里删除了大量文本,很可能导致正在使用的图片被删除
  57. 暂时第三方上传的试卷还是先不要删除比较稳妥!或新建图片用md5命名
  58. :return:
  59. """
  60. items_str = str(self.items_list)
  61. raw_imgs = []
  62. # img_source = "" http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/imgpaper/lqy_upload/612f60307ddb8b2765e50512/img_23.png
  63. img_source = ""
  64. items_str = re.sub(r'(<img src=)\'(.*?/(imgpaper/lqy_upload|zyk/uploadfiles/wording)/[^\']*?)\'', r'\1"\2"', items_str)
  65. if "imgpaper/lqy_upload" in items_str:
  66. raw_imgs = re.findall(r'<img src=".*?/(imgpaper/lqy_upload/[^"\']*?)"', items_str) # pdf/图片
  67. img_source = "p"
  68. elif "zyk/uploadfiles/wording/" in items_str:
  69. img_source = "w" # word
  70. # elif "stem_img" not in self.items_list[0]: # 批量解析时没有stem_img字段,但最后前端页面都会补上
  71. # img_source = "w"
  72. # elif any([True if "stem_img" in i and i["stem_img"] else False for i in self.items_list]):
  73. # img_source = "p"
  74. # else:
  75. # img_source = "w"
  76. # pdf/图片解析时,再解析新生成的图片也是用的zyk/uploadfiles/wording/
  77. logger.info("----【paper_id:{}】本套试卷类型:{}".format(self.wordid, img_source))
  78. # mj_pic = re.findall(r'<img src=".*?/(zyk/[^"\']+?/MJMATH-\d)', items_str)
  79. if img_source:
  80. time1 = time.time()
  81. raw_imgs.extend(re.findall(r'<img src=".*?/(zyk/uploadfiles/wording/[^"\']*?)"', items_str))
  82. bucket_imgs = img_inbucket_count(self.wordid, flag=img_source) # 如果img_source判断错误,则不进行后续操作
  83. logger.info("----【paper_id:{}】从桶里取数据时间:{}".format(self.wordid, time.time() - time1))
  84. time2 = time.time()
  85. if bucket_imgs:
  86. # 再解析过程中若删除了原已上传到腾讯云上的图片信息,需要判断下是否删除桶中的图片
  87. # 也有可能出现保存一遍后再保存
  88. # bucket_imgs = [i['Key'] for i in bucket_imgs] # dict:[{'Key': put_key}, {}]
  89. # print("bucket_imgs:", bucket_imgs)
  90. # print("raw_imgs:", raw_imgs)
  91. if len(bucket_imgs) - len(raw_imgs) > 5: # 多余图片超过5张才开始删除,包含mathjax生成的图片
  92. bucket_imgs = [i['Key'] for i in bucket_imgs] # dict:[{'Key': put_key}, {}]
  93. to_del_imgs = [bimg for bimg in bucket_imgs if bimg not in raw_imgs]
  94. if to_del_imgs:
  95. objects = {
  96. "Quiet": "true",
  97. "Object": [{'Key': item} for item in to_del_imgs]
  98. }
  99. client.delete_objects(configs.public_bucket, objects) # 批量删除
  100. logger.info("----【paper_id:{}】删除桶数据时间:{}".format(self.wordid, time.time() - time2))
  101. def mathjx2png(self):
  102. """
  103. 【基于mathjax渲染输出是svg格式】
  104. 将mathjax渲染的公式转化为图片格式
  105. mathjax渲染的svg图片提取->保存->格式转化
  106. :return:
  107. """
  108. file_path = configs.IMG_FOLDER + "/" + str(self.wordid)
  109. svgp_ltx = {} # svg图片本地路径 映射 latex
  110. put_key_mjmath = [] # 桶中key
  111. local_mjmath = [] # 本地图片存储位置
  112. self.ltx2url = {} # latex 映射 线上可访问url
  113. ltx2svgcss = {} # latex 映射 svg-css
  114. if self.callback_url and "MathJax" in str(self.svg_data["svg_html_data"]): # 再解析中存在mathjax公式渲染的标签
  115. # 需要统计mathjax转png失败时的具体定位 初始思路:based on 索引而展开二分法查找
  116. # 题号所在位置 topicinfo topicidx topicno
  117. # topicinfo = [[nm.end(), nm.group(1)] for nm in re.finditer('class="topic-number">(\d+)\.',
  118. # str(self.svg_data["svg_html_data"]))]
  119. # topicidx = [i[0] for i in topicinfo]
  120. # topicno = [i[1] for i in topicinfo]
  121. time3 = time.time()
  122. all_mathjax = []
  123. for topic_n, one_svghtml in enumerate(self.svg_data["svg_html_data"]):
  124. # some_mathjax = [[a.start(), a.group(1)] for a in
  125. # re.finditer('(<span class="MathJax_Preview".*?</script>(</span>)*)', one_svghtml)]
  126. some_mathjax = [[topic_n+1, a.group(1)] for a in
  127. re.finditer('(<span class="MathJax_Preview".*?</script>(</span>)*)', one_svghtml)]
  128. all_mathjax.extend(some_mathjax)
  129. # all_mathjax = [[a.start(), a.group(1)] for a in
  130. # re.finditer('(<span class="MathJax_Preview".*?</script>(</span>)*)',
  131. # str(self.svg_data["svg_html_data"]))]
  132. all_linkdata = re.findall('(<path stroke-width=".*?" id="(.*?)" d=".*?"></path>)', self.svg_data["svg_path"])
  133. link_dict = {a[1]: a[0] for a in all_linkdata if a}
  134. # all_svg, all_latex = [], []
  135. for n, jax in enumerate(all_mathjax):
  136. svgs = re.findall("<svg .*?</svg>", jax[1])
  137. latex = re.findall('<script .+?">(((?!(</)).)*?)</script>(</span>)*', jax[1])
  138. if latex and svgs:
  139. latex_sub = re.sub(r"\\text{\s*\}|[{\}]", "", latex[0][0])
  140. if latex and not latex_sub.strip():
  141. # id_idx = bisect_left(topicidx, jax[0]) # based on 索引而展开二分法查找
  142. logger.info("----【paper_id:{}】第{}题存在mathjax公式为空:latex:{}\nsvg:{}".format(
  143. self.wordid, jax[0], latex, svgs)) # topicno[id_idx - 1]
  144. else:
  145. ltx2svgcss["{}".format(latex[0][0])] = svgs[0] # latex去重
  146. else:
  147. # id_idx = bisect_left(topicidx, jax[0]) # based on 索引而展开二分法查找
  148. logger.info("----【paper_id:{}】第{}题存在mathjax公式格式有问题:latex:{}\nsvg:{}".format(
  149. self.wordid, jax[0], latex, svgs))
  150. if latex:
  151. return "第{}题的公式latex:{}不规范,请编辑正确!".format(jax[0], latex[0][0])
  152. else:
  153. return "第{}题的存在不规范的公式,,请重新编辑!".format(jax[0])
  154. if ltx2svgcss:
  155. if not os.path.exists(file_path):
  156. os.makedirs(file_path)
  157. svg_mjmath_path = os.path.join(file_path, "svg_mjmath")
  158. if not os.path.exists(svg_mjmath_path):
  159. os.makedirs(svg_mjmath_path)
  160. else: # 需要清空
  161. shutil.rmtree(svg_mjmath_path)
  162. os.makedirs(svg_mjmath_path)
  163. n = 0
  164. name_list = random.sample(range(100000, 999999), len(ltx2svgcss)) # 随机数
  165. for ltx, svg in ltx2svgcss.items():
  166. linkkeys = list(set(re.findall(' xlink:href="#(.*?)"', svg)))
  167. linkvalues = [link_dict[ld] for ld in linkkeys]
  168. svg_p = file_path + "/svg_mjmath/MJMATH-{}.svg".format(str(int(time.time())) + str(name_list[n]))
  169. fs = open(svg_p, 'w', encoding='utf8')
  170. svg_1, svg_2 = svg.split("<g ", maxsplit=1)
  171. fs.write(svg_1)
  172. fs.write('<defs id="MathJax_SVG_glyphs">\n' + "\n".join(linkvalues) + "\n</defs>")
  173. fs.write("<g " + svg_2)
  174. fs.close()
  175. svgp_ltx[svg_p] = ltx
  176. n += 1
  177. logger.info(json.dumps({"log_level": "info",
  178. "paper_id": self.wordid,
  179. "mathjax2svg_time": time.time() - time3,
  180. "svgp_ltx": svgp_ltx}, ensure_ascii=False).encode("utf-8"))
  181. time4 = time.time()
  182. # 2.2>>svg转png
  183. if svgp_ltx:
  184. try:
  185. with ThreadPoolExecutor(max_workers=6) as t:
  186. all_png_info = [t.submit(svg2png, arg) for arg in svgp_ltx.keys()]
  187. except Exception as e:
  188. logger.info(json.dumps({"log_level": "warn",
  189. "paper_id": self.wordid,
  190. "status": "svg2png失败",
  191. "errmsg": str(e)}, ensure_ascii=False))
  192. all_png_info = []
  193. all_png_info = [i.result() for i in all_png_info]
  194. for shape, img_path in all_png_info:
  195. local_mjmath.append(img_path)
  196. imgname_online = "/zyk/uploadfiles/wording/" + str(self.wordid) + "/{}".format(os.path.basename(img_path))
  197. put_key_mjmath.append(imgname_online)
  198. mj_ltx = svgp_ltx[img_path.replace(".png", ".svg")] #.replace("\\\\", "\\")
  199. w = shape[0] / 4 * 1.2
  200. h = shape[1] / 4 * 1.2
  201. if re.search(r"^{?[A-Z、\s{_\}\d]+\}?$", mj_ltx):
  202. w = shape[0] / 4
  203. h = shape[1] / 4
  204. mjmath_online = '<img src="http://' + configs.public_bucket_addr + imgname_online \
  205. + '" width="{}" height="{}" data-type="math" data-latex="{}" />'.format(
  206. int(w), int(h), "${}$".format(mj_ltx)) # shape[0] / 2
  207. self.ltx2url[mj_ltx] = mjmath_online
  208. logger.info(json.dumps({"log_level": "info",
  209. "paper_id": self.wordid,
  210. "svg2png_time": time.time() - time4,
  211. "ltx2url": self.ltx2url}, ensure_ascii=False))
  212. return put_key_mjmath, local_mjmath
  213. def upload_img(self):
  214. """
  215. items_list:结构化纯文本
  216. htmlt:ocr或word解析后的html文本
  217. svg_data:{"svg_html_data": "", "svg_path": ""} 含svg数据的结构化整体html文本,svg中的索引数据
  218. wordid:试卷存储id
  219. callback_url: 回调地址
  220. 入库操作包含:
  221. 1、再解析后确认入库时,将image上传,htmlt中图片;
  222. 2、学管端可以是组合(文本+图片)的解析结果。学管可以选择和修改文本,但选择的文本解析时都会替换原先的img标签内容,
  223. 最后入库时,传回学管端的都是带img标签的结果
  224. 3、传回学管端和共享题库的题目中的$$公式要转换为图片;
  225. $$左右还有公式字符串的话,在结构化过程中一起并入!!!
  226. 4、调取查重关联功能,暂时不调自动标注;
  227. 5、传入校本题库(发送标注),将结构化后的每道题设置个与大数据资源库的关联标签,如"zyk_id":id+题号
  228. 5种图片:1>>ser_static/.*?/word/media(解析服务中最开始保存在线上服务器本地)
  229. 2>>/zyk/uploadfiles/wording/(解析服务中上传到腾讯云)
  230. 3、4>>ser_static/.*?/(new_image[^"]*?|eq_img_\d.png):批量再解析和单题再解析中,
  231. 用户在编辑页面新粘贴进来的base64图片,以及批量再解析中域公式转图片,临时存在结构化服务器本地
  232. 5、利用mathjax渲染latex的svg格式转为png,再上传到腾讯云
  233. 上传之前,将腾讯云桶里的new_image全部替换,raw_image判断下再替换
  234. items_list:list 所有题目
  235. :return:
  236. res_zyk = {"data":{"html": xxx, "items": xxx}, "errcode": 0, "errmsgs": ""}
  237. res_xbk = {"items": xxx, "errcode": 0, "errmsg":"ok"}
  238. """
  239. # if not self.items_list:
  240. # return {"errcode":1, "errmsgs": "无结果,不能入库", "data":{}}
  241. #
  242. # # if any([True if "stem_img" not in i and "stem" not in i else False
  243. # # for i in self.items_list]): # 存在新增的空试题时,只有3个字段type,img_status,check_type
  244. # # return {"errcode":1, "errmsgs": "存在空试题,请检查!", "data":{}}
  245. # contain_id = []
  246. # for i in self.items_list:
  247. # if "stem_img" not in i and "stem" not in i:
  248. # return {"errcode": 1, "errmsgs": "存在空试题,请检查!", "data": {}}
  249. # if contain_id:
  250. # return {"errcode": 1, "errmsgs": "存在报错试题【{}题】还没改正过来,请检查!".format("、".join(contain_id)), "data": {}}
  251. # elif "errmsgs" in i and i["errmsgs"]:
  252. # return {"errcode": 1, "errmsgs": "存在报错试题还没改正过来,请检查!", "data": {}}
  253. res_xbk = {"items": [], "errcode": 0, "errmsg": "ok", "callback_type": 2, "subject_id": self.subject}
  254. res_zyk = {"errcode": 0, "errmsgs": "", "data": {"html": self.htmlt, "items": self.items_list}}
  255. # 1>>判断删除腾讯云桶内图片
  256. # self.bucket_img_del()
  257. # ---------------------------------------------------------------------
  258. # 1.2>>将zyk/uploadfiles/wording/ 路径的缺latex的公式图片,再调mathpix接口拿到latex填充
  259. # 2>>mathjax渲染的svg图片提取->保存->格式转化
  260. svg_convert_res = self.mathjx2png()
  261. if type(svg_convert_res) == str:
  262. res_xbk = {"items": [], "errcode": 1, "errmsg": svg_convert_res, "callback_type": 2, "subject_id": self.subject}
  263. res_zyk = {"errcode": 1, "errmsgs": svg_convert_res, "data": {}}
  264. if self.callback_url:
  265. self.callback_user(res_xbk, self.callback_url)
  266. if self.source == "xue_guan":
  267. self.callback_php(res_xbk) # 失败时就不发送数据库端了,但学管端时发送
  268. return res_zyk
  269. put_key_mjmath, local_mjmath = svg_convert_res
  270. # --------------------------------------------------------------------
  271. # 3>> 统计 ocr和结构化试题 中的新图片,以防结构化入库的试题少了而导致图片上传不足,左边页面无法显示
  272. put_key_list = [] # 桶中key
  273. localnewpic_list = [] # 本地图片存储位置
  274. imgs_url_list = [] # 远程服务器上图片存储位置
  275. put_key_imgsurl = []
  276. new_imgs = re.findall(r'<img src=".*?/ser_static/.*?/(new_image[^"]*?|eq_img_\d+\.png)"', str(self.htmlt))
  277. new_imgs2 = re.findall(r'<img src=".*?/ser_static/.*?/(new_image[^"]*?|eq_img_\d+\.png)"', str(self.items_list))
  278. new_imgs.extend(new_imgs2)
  279. # print(new_imgs)
  280. new_imgs = list(set(new_imgs))
  281. if new_imgs:
  282. put_key_list.extend(["/zyk/uploadfiles/wording/" + str(self.wordid) + "/{}".format(img_name)
  283. for img_name in new_imgs])
  284. file_path = configs.IMG_FOLDER + "/" + str(self.wordid)
  285. localnewpic_list.extend([file_path + "/field_eq/" + img_name if "eq_img_" in img_name
  286. else file_path + "/" + img_name for img_name in new_imgs])
  287. old_imgs = re.findall(r'<img src="(.*?/ser_static[/\\](.*?/word/media)/(image[^"]*?))"', str(self.htmlt))
  288. print("old_imgs:", old_imgs)
  289. if old_imgs: # 针对最开始入库的情况,后期都直接在wordbin时就上传腾讯云了
  290. # 以前新添加的图片在左预览页仍以base64保存,若再解析,则会按新的方法保存到本地
  291. # 只是最开始解析的老图片是保存在服务器本地的,若入库时,则一起拿出来再上传腾讯云
  292. if configs.external_ip not in old_imgs[0][0]: # 非本地图片
  293. # if '82.156.255.225' not in old_imgs[0][0]:
  294. imgs_url_list.extend([img_name[0] for img_name in old_imgs])
  295. put_key_imgsurl.extend(["/zyk/uploadfiles/wording/" + str(self.wordid) + "/{}".format(img[2])
  296. for img in old_imgs])
  297. else: # 本地图片
  298. file_path = configs.RawImg_UploadFolder + "/" + old_imgs[0][1]
  299. put_key_list.extend(["/zyk/uploadfiles/wording/" + str(self.wordid) + "/{}".format(img[2])
  300. for img in old_imgs])
  301. localnewpic_list.extend([file_path + "/" + img[2] for img in old_imgs])
  302. # print('*****************************put_key_list*******************************')
  303. # print(put_key_list)
  304. # print('*****************************localnewpic_list*******************************')
  305. # print(localnewpic_list)
  306. if self.callback_url:
  307. put_key_list.extend(put_key_mjmath)
  308. localnewpic_list.extend(local_mjmath)
  309. # ------------------------------------------------------------------------------------------
  310. items_res_to_xbk = []
  311. repeat_time = 0
  312. # kps_label_time = 0
  313. if localnewpic_list or imgs_url_list: # 本地有新图片时
  314. new_img_online = '<img src="http://' + configs.public_bucket_addr + "/zyk/uploadfiles/wording/" + str(self.wordid)
  315. new_img_local = '<img src="' + configs.new_img_ip + '/' + str(self.wordid) # 结构化中产生的图片
  316. old_img_local = "" # wordbin最初产生的图片
  317. if old_imgs:
  318. # new_img_local = '<img src="' + configs.old_img_ip + '/' + old_imgs[0][0]
  319. old_img_local = '<img src="' + old_imgs[0][0].split("ser_static")[0]+"ser_static" + '/' + old_imgs[0][1]
  320. def sub1(s):
  321. """图片访问地址替换,本地替换为线上"""
  322. if s:
  323. s = re.sub(r'(<img src="[^"]*?[a-z\d])\\(?!\\)([^"]*?")', r"\1/\2", str(s)) # 将路径中的\改为/
  324. s = s.replace(new_img_local, new_img_online)
  325. if old_img_local:
  326. return s.replace(old_img_local, new_img_online)
  327. return s
  328. def sub2(s):
  329. """将试题中的latex转为线上可访问图片地址"""
  330. if s:
  331. all_ltx = re.findall(r'\$.*?\$', s) # 查找试题结构中的公式
  332. all_ltx.extend(re.findall('\\\\\(.*?\\\\\)', s))
  333. all_ltx = list(set(all_ltx))
  334. for ltx in all_ltx:
  335. new_ltx = ltx.replace("$", "").replace("\\(", "").replace("\\)", "")\
  336. .replace("&amp;", "&").replace("&lt;", "<") #.replace(" ", "\\u200a")
  337. if new_ltx in self.ltx2url: # 将latex换为其渲染图片的线上可访问地址
  338. s = s.replace(ltx, self.ltx2url[new_ltx])
  339. else:
  340. logger.info("----【word_id:{}】latex替换为imgurl失败:{}".format(self.wordid, new_ltx))
  341. s = re.sub(r' data-latex="<img .*?data-latex=(".*?").*?/>"\s*/>', r" data-latex=\1 />", s)
  342. return s
  343. def ltx2url_repl(one_items):
  344. """
  345. 将每道题结构中的各字段进行匹配替换 ltx2url
  346. """
  347. keys_items = ["stem", "key", "parse", "options", "slave"]
  348. if self.ltx2url:
  349. for k in keys_items:
  350. if k in one_items:
  351. if k == "options":
  352. one_items[k] = list(map(sub2, one_items[k]))
  353. elif k == "slave" and one_items[k]:
  354. for slave_one in one_items[k]:
  355. ltx2url_repl(slave_one)
  356. else:
  357. one_items[k] = sub2(one_items[k])
  358. # else:
  359. # if "topic_num" in one_items:
  360. # logger.info("----【word_id:{}】第{}道题{}字段有问题".format(self.wordid, one_items["topic_num"], k))
  361. # else:
  362. # logger.info("----【word_id:{}】{}字段有问题".format(self.wordid, k))
  363. # -------------------------------------------------------------
  364. time6 = time.time()
  365. # 4>> 结构化题目中图片地址替换,需要区分下学管端还是云题库!!!!!一定会保存一份在资源库
  366. items_res_to_zyk = self.items_list.copy()
  367. items_res_to_zyk = eval(sub1(items_res_to_zyk))
  368. # for one_items in items_res_to_zyk:
  369. # for k in ["stem", "key", "parse", "options"]: # "analysis",
  370. # if k in one_items:
  371. # if k == "options":
  372. # one_items[k] = list(map(sub1, one_items[k]))
  373. # else:
  374. # one_items[k] = sub1(one_items[k])
  375. # -----------难度和知识点自动标注------------------------
  376. diffs_xbk, items_res_to_zyk = self.get_diff(items_res_to_zyk.copy()) # 难度
  377. for nn, one_items in enumerate(deepcopy(items_res_to_zyk)):
  378. new_one_item = {}
  379. if self.subject == 3: # "高中数学"
  380. new_one_item["difficulty"] = diffs_xbk[nn]
  381. # if one_items["checkType"]["name"] == "填空题":
  382. # new_one_item["blank_num"] = one_items["blank_num"]
  383. # keys_items = ["stem", "key", "parse", "options"]
  384. # if one_items['img_status'] == 1 and ("stem_img" in one_items and one_items["stem_img"]):
  385. # logger.info("----【paper_id:{}】mathjax2svg所取的字段是带img的".format(self.wordid))
  386. # keys_items = ["stem_img", "key_img", "parse_img", "options_img"]
  387. if self.callback_url:
  388. # 查重
  389. if self.source != "xue_guan":
  390. repeat_r, repeat_time = self.repeat_check(nn, one_items, repeat_time)
  391. if type(repeat_r) == str:
  392. res_xbk = {"items": [], "errcode": 1, "errmsg": repeat_r, "callback_type": 2, "subject_id": self.subject}
  393. res_zyk = {"errcode": 1, "errmsgs": repeat_r, "data": {}}
  394. self.callback_user(res_xbk, self.callback_url)
  395. return res_zyk
  396. new_one_item["repeat_res"] = repeat_r
  397. new_one_item["topic_type_id"] = one_items["checkType"]["id"]
  398. if "options_rank" in one_items and one_items["options_rank"]:
  399. new_one_item["options_rank"] = one_items["options_rank"]
  400. ltx2url_repl(one_items)
  401. one_items = self.slave2regroup(one_items)
  402. new_one_item.update(one_items)
  403. # for k in keys_items:
  404. # if k in one_items:
  405. # if self.ltx2url:
  406. # if k == "options":
  407. # one_items[k] = list(map(sub2, one_items[k]))
  408. # else:
  409. # one_items[k] = sub2(one_items[k])
  410. # new_one_item[k] = one_items[k]
  411. # else: # 有的题本来就没有options字段
  412. # logger.info("----【paper_id:{}】第{}道题{}字段有问题".format(self.wordid, one_items["topic_num"], k))
  413. items_res_to_xbk.append(new_one_item)
  414. # 5>> ocr-htmlt中图片地址替换成云上地址
  415. self.htmlt = re.sub(r'(<img src="[^"]*?[a-z\d])\\(?!\\)([^"]*?")', r"\1/\2", self.htmlt)
  416. self.htmlt = self.htmlt.replace(new_img_local, new_img_online)
  417. if old_img_local:
  418. self.htmlt = self.htmlt.replace(old_img_local, new_img_online)
  419. logger.info(json.dumps({"log_level": "info",
  420. "paper_id": self.wordid,
  421. "imgurl_repl_time": time.time() - time6,
  422. "repeat_time": repeat_time}, ensure_ascii=False))
  423. # -----------------------------------------------------------------------
  424. # 6 >> new_image上传腾讯云
  425. try:
  426. logger.info('----【paper_id:{}】再解析开始上传图片到cloud,并替换成线上地址----'.format(self.wordid))
  427. stime_u = time.time()
  428. # TODO 一个进程解析,一个进程上传
  429. executor1 = ThreadPoolExecutor(5)
  430. executor1.map(upload_img_to_qcloud, zip(put_key_list, localnewpic_list))
  431. if imgs_url_list:
  432. executor1.map(filestream_upload, zip(put_key_imgsurl, imgs_url_list))
  433. executor1.shutdown(wait=True) # 进程池内部的进程都执行完毕,才会关闭,然后执行后续代码
  434. img_upload_time = time.time() - stime_u
  435. logger.info(json.dumps({"log_level": "info",
  436. "paper_id": self.wordid,
  437. "img_upload_time": img_upload_time}, ensure_ascii=False))
  438. res_zyk = {"data": {"html": self.htmlt, "items": items_res_to_zyk}, "errcode": 0, "errmsgs": ""}
  439. res_xbk = {"items": items_res_to_xbk, "errcode": 0, "errmsg": "ok", "callback_type": 2, "subject_id": self.subject}
  440. except Exception as e:
  441. res_xbk = {"items": [], "errcode": 1, "errmsg": "公式或图片上传腾讯云失败", "callback_type":2, "subject_id": self.subject}
  442. res_zyk = {"data":{"html": self.htmlt, "items": self.items_list}, "errcode": 1,
  443. "errmsgs": "公式或图片上传腾讯云失败"}
  444. logger.info(json.dumps({"log_level": "warn",
  445. "paper_id": self.wordid,
  446. "status": "公式或图片上传腾讯云失败",
  447. "errmsg": str(e)}, ensure_ascii=False))
  448. else: # 本地没有新图片时
  449. # -----------难度、知识点自动标注------------------------
  450. diffs_xbk, self.items_list = self.get_diff(self.items_list) # 难度
  451. if self.callback_url:
  452. for nn, one_items in enumerate(self.items_list):
  453. new_one_item = {}
  454. if self.subject == 3: # "高中数学"
  455. new_one_item["difficulty"] = diffs_xbk[nn]
  456. # 查重
  457. if self.source != "xue_guan":
  458. repeat_r, repeat_time = self.repeat_check(nn, one_items, repeat_time)
  459. if type(repeat_r) == str:
  460. res_xbk = {"items": [], "errcode": 1, "errmsg": repeat_r, "callback_type": 2, "subject_id": self.subject}
  461. res_zyk = {"errcode": 1, "errmsgs": repeat_r, "data": {}}
  462. self.callback_user(res_xbk, self.callback_url)
  463. return res_zyk
  464. new_one_item["repeat_res"] = repeat_r
  465. new_one_item["topic_type_id"] = one_items["checkType"]["id"]
  466. if "options_rank" in one_items and one_items["options_rank"]:
  467. new_one_item["options_rank"] = one_items["options_rank"]
  468. one_items = self.slave2regroup(one_items)
  469. new_one_item.update(one_items)
  470. # keys_items = ["stem", "key", "parse", "options"]
  471. # for k in keys_items:
  472. # if k in one_items:
  473. # new_one_item[k] = one_items[k]
  474. items_res_to_xbk.append(new_one_item)
  475. res_xbk = {"items": items_res_to_xbk, "errcode": 0, "errmsg": "ok", "callback_type": 2, "subject_id": self.subject}
  476. logger.info(json.dumps({"log_level": "info",
  477. "paper_id": self.wordid,
  478. "repeat_time": repeat_time}, ensure_ascii=False))
  479. # 先传一份到校本题库,再返回结果
  480. if self.callback_url:
  481. # 知识点自动标注--批量
  482. if self.subject == 3 and self.source == "qtk": # "高中数学"
  483. try:
  484. res_xbk = self.get_kps_auto(res_xbk)
  485. except Exception as e:
  486. logger.info("----【paper_id:{}】高中数学标注异常:{}".format(self.wordid, e))
  487. # 回调前,将结果保存本地一份
  488. self.save_post_file(res_xbk)
  489. have_err = self.callback_user(res_xbk, self.callback_url)
  490. if self.source == "xue_guan" or not have_err: # 失败时就不发送数据库端了,但学管端时发
  491. self.callback_php(res_xbk)
  492. return res_zyk
  493. def slave2regroup(self, one_items):
  494. """
  495. 将拆分的小题根据是否为旧题型进行重组,如果保存时选择的旧题型就要组合成三段式
  496. 对判断题的答案进行转化:正确-->A;错误-->B
  497. :return:
  498. """
  499. # 此阶段将每个题可能的报错信息去掉
  500. if "errmsgs" in one_items and one_items["errmsgs"]:
  501. one_items["errmsgs"] = ""
  502. if "btt_id" not in one_items["checkType"] or one_items["checkType"]["btt_id"] != 13:
  503. if "slave" in one_items and one_items["slave"]: # 带小题的
  504. for idn, s in enumerate(one_items["slave"]):
  505. if not one_items["stem"] and not idn and s["stem"].strip():
  506. one_items["stem"] += "(1)" + s["stem"]
  507. elif s["stem"].strip():
  508. one_items["stem"] += "<br/>({})".format(idn + 1) + s["stem"]
  509. if not one_items["key"] and not idn and s["key"].strip():
  510. one_items["key"] += "(1)" + s["key"]
  511. elif s["key"].strip():
  512. one_items["key"] += "<br/>({})".format(idn + 1) + s["key"]
  513. if not one_items["parse"] and not idn and s["parse"].strip():
  514. one_items["parse"] += "(1)" + s["parse"]
  515. elif s["parse"].strip():
  516. one_items["parse"] += "<br/>({})".format(idn + 1) + s["parse"]
  517. if "options" in s and s["options"]:
  518. one_items["stem"] += "<br/>" + "<br/>".join(["{}、{}".format(chr(ord('@') + idm + 1),
  519. option) for idm, option in enumerate(s["options"])])
  520. one_items["slave"] = []
  521. if "btt_id" in one_items["checkType"] and one_items["checkType"]["btt_id"] not in [5, 6, 7]:
  522. one_items["stem"] = re.sub(r'<span style="color:RGB\(50%,40%,30%\); blank space">(__{2,})</span>',
  523. r"\1", one_items["stem"])
  524. else:
  525. # if "btt_id" in one_items["checkType"] and one_items["checkType"]["btt_id"] == 13:
  526. # 将小问答案没拆出来的部分放入公共解析字段中
  527. if "slave" in one_items and one_items["slave"] and one_items["key"] and \
  528. all([True if not s["key"].strip() else False for s in one_items["slave"]]): # 带小题的且小题答案都为空
  529. if one_items["parse"].strip():
  530. one_items["parse"] = "【答案】\n{}\n【解析】\n{}".format(one_items["key"], one_items["parse"])
  531. else:
  532. one_items["parse"] = "【答案】\n{}".format(one_items["key"])
  533. one_items["key"] = ""
  534. if "btt_id" in one_items["checkType"] and one_items["checkType"]["btt_id"] == 12: # 判断题
  535. one_items["answer_type"] = 4
  536. if re.match("(?<!不)对|(?<!不)正确|[T√]$", one_items["key"]):
  537. one_items["key"] = "正确"
  538. elif re.match("错误?的?|不对的?|不正确的?|[F×]$", one_items["key"]):
  539. one_items["key"] = "错误"
  540. return one_items
  541. def save(self):
  542. """
  543. 入口函数
  544. :return:
  545. """
  546. res_xbk = {"items": [], "errcode": 1, "errmsg": "保存失败", "callback_type": 2, "subject_id": self.subject}
  547. try:
  548. res_zyk = self.upload_img()
  549. return res_zyk
  550. except Exception as e:
  551. print("------【paper_id:{}】最后的保存失败:{}-------".format(self.wordid, str(e)))
  552. logger.info(json.dumps({"log_level": "warn",
  553. "paper_id": self.wordid,
  554. "status": "入库失败",
  555. "errmsg": str(e),
  556. "task_name": "保存入库"}, ensure_ascii=False))
  557. if self.callback_url:
  558. self.callback_code = 1
  559. self.callback_err = "保存失败"
  560. self.callback_user(res_xbk, self.callback_url, err="1")
  561. if self.source == "xue_guan":
  562. self.callback_php(res_xbk) # 失败时就不发送数据库端了,但学管端时发
  563. return {"errcode": 1, "errmsgs": "入库失败!", "data": {}}
  564. def save_post_file(self, parse_res):
  565. """保存回调的数据解析结果"""
  566. now_time = datetime.datetime.now()
  567. time_str = datetime.datetime.strftime(now_time, '%Y_%m_%d_%H_%M_%S')
  568. # aft_modify = (str("word_name") + '__' + str(random.random())).encode("utf-8")
  569. # hh = hashlib.md5(aft_modify).hexdigest()
  570. aft_name = self.wordid + '__' + time_str + '.json'
  571. res_folder = configs.RES_FOLDER # 保存的文件夹
  572. new_fpath = os.path.join(res_folder, aft_name)
  573. re_f = open(new_fpath, 'w', encoding='utf-8')
  574. json.dump(parse_res, re_f,ensure_ascii=False)
  575. def get_kps_auto(self, all_items):
  576. """
  577. 调取自动标注的端口获取考点
  578. :return:
  579. """
  580. def phy_kps(input_data):
  581. label_auto = {}
  582. if input_data:
  583. r = requests.post(configs.kps_phy_ip, json=input_data) # json={"input_data": item}
  584. if r.status_code == 200:
  585. res = r.json()['result'] # eval(r.text)
  586. if res:
  587. label_auto.update(res)
  588. return label_auto
  589. def Hmath_kps(input_data):
  590. label_auto = []
  591. try:
  592. r = requests.post(configs.kps_Hmath_ip, json=input_data) # json={"input_data": item}
  593. if r.status_code == 200:
  594. res = r.json() # eval(r.text)
  595. if res and 'data' in res:
  596. label_auto = res['data']
  597. except Exception as e:
  598. logger.info("----【paper_id:{}】标注服务异常:{}".format(self.wordid, e))
  599. return "保存入库高中数学标注服务异常"
  600. return label_auto
  601. t1= time.time()
  602. # 高中物理
  603. # temp_items = {"server_state": 11,
  604. # "fine_state": 0,
  605. # "add_parse_state": 1}
  606. # one_info = {"topic_id": one_items["topic_num"],
  607. # "content": one_items["stem"],
  608. # "option": one_items["options"] if "options" in one_items else [],
  609. # "parse": one_items["parse"],
  610. # "kpl_codes": [], "ori_sences": [], "ori_kpl_codes": [],
  611. # "topic_type_id": one_items["checkType"]["id"]}
  612. # temp_items["info"] = one_info
  613. # 高中数学
  614. # stems = one_items["stem"]
  615. # if "slave" in one_items and one_items["slave"]:
  616. # stem_l = [s["slave_no"] + s["stem"] + "<br/>"+ "<br/>".join(s["options"])
  617. # if "options" in s and s["options"] else s["slave_no"] + s["stem"] for s in one_items["slave"]]
  618. # stems += "<br/>".join(stem_l)
  619. items = all_items["items"]
  620. items_info = {"subject_id": self.subject,
  621. "topics": [{"topic_id": "123", # one_items["id"]
  622. "topic_type_id": one_items["checkType"]["id"],
  623. "content": one_items["stem"],
  624. "parse": one_items["parse"] if "parse" in one_items else "",
  625. "option": one_items["options"] if "options" in one_items else [],
  626. "resource_type": 0,
  627. "slave": one_items["slave"] if "slave" in one_items else []} for one_items in items]
  628. }
  629. auto_kps = Hmath_kps(items_info)
  630. if not auto_kps or type(auto_kps) == str:
  631. pass
  632. else:
  633. for nn, one_items in enumerate(all_items["items"]):
  634. one_items.update({"auto_mark_result": auto_kps[nn]})
  635. # all_items["items"] = [lambda x:one_items.update({"auto_mark_result": auto_kps[nn]})
  636. # for nn, one_items in enumerate(all_items["items"])]
  637. # print("自动标注考点:", auto_kps)
  638. logger.info(json.dumps({"log_level": "info",
  639. "paper_id": self.wordid,
  640. "automark_time": time.time() - t1}, ensure_ascii=False))
  641. return all_items
  642. def img2latex(self):
  643. # 3>> 统计结构化试题data-latex为空的图片,再ocr-latex处理并替换
  644. time5 = time.time()
  645. items_str = str(self.items_list)
  646. all_imgs_no_latex = re.findall(r'(<img src="(.*?)".*? data-latex="\$?\s*\$?")', items_str)
  647. if all_imgs_no_latex:
  648. imgurl_no_latex = [k[1] for k in all_imgs_no_latex]
  649. imgurl_no_latex = list(set(imgurl_no_latex))
  650. mathpixs = []
  651. try:
  652. if len(imgurl_no_latex) <= 20:
  653. mathpixs.extend([get_ocrlatex_by_url(i) for i in imgurl_no_latex])
  654. else:
  655. if len(imgurl_no_latex) <= 50:
  656. executor = ThreadPoolExecutor(max_workers=2) # 开2个线程会稍微快点
  657. else:
  658. executor = ThreadPoolExecutor(max_workers=4)
  659. for data in executor.map(get_ocrlatex_by_url, imgurl_no_latex):
  660. mathpixs.append(data)
  661. logger.info("----【paper_id:{}】latex-ocr:{}".format(self.wordid, mathpixs))
  662. def sub3(ss):
  663. new_ss = ss.group(1) + ' data-type="math-ocr" data-latex="$' + mathpixs[mi] + '$"' + ss.group(2)
  664. return new_ss.replace(' data-type="math"', "")
  665. # return ss.group(1) + 'data-type="math-ocr" data-latex="$' + mathpixs[mi] + '$"'
  666. for mi, m in enumerate(imgurl_no_latex):
  667. # items_str = re.sub(r'(<img src="{}".*?) data-latex="\$?\s*\$?"'.format(m), sub3, items_str)
  668. if mathpixs[mi]:
  669. items_str = re.sub(r'(<img src="{}".*?) data-latex="\$?\s*\$?"(.*?(?<=")\s*/?>)'.format(m),
  670. sub3, items_str)
  671. self.items_list = eval(items_str)
  672. logger.info("----【paper_id:{}】结构化试题中空latex掉mathpix转化时间:{}".format(self.wordid, time.time() - time5))
  673. except:
  674. logger.info("----【paper_id:{}】latex-ocr转化过程失败".format(self.wordid))
  675. # -------------------------------------------------------------------
  676. def get_diff(self, items_res_to_zyk):
  677. # -----------难度自动标注------------------------
  678. # t11 = time.time()
  679. diffs_xbk = [3] * len(items_res_to_zyk)
  680. # if self.subject == "高中数学": # 难度自动标注暂时不用了
  681. # from multiprocessing.dummy import Pool as ThreadPool
  682. # pool = ThreadPool(2) # 比# pool = multiprocessing.Pool(3)速度快
  683. # diff_info = list(pool.map(get_item_diff, items_res_to_zyk))
  684. # items_res_to_zyk = [f[0] for f in diff_info]
  685. # diffs_xbk = [f[1] for f in diff_info]
  686. # logger.info("----【paper_id:{}】结构化试题中难度标注时间:{}".format(self.wordid, time.time() - t11))
  687. return diffs_xbk, items_res_to_zyk
  688. def repeat_check(self, id, one_items, repeat_time):
  689. t22 = time.time()
  690. stems = one_items["stem"]
  691. # if "slave" in one_items and one_items["slave"]:
  692. # stem_l = [s["slave_no"] + s["stem"] + "<br/>"+ "<br/>".join(s["options"])
  693. # if "options" in s and s["options"] else s["slave_no"] + s["stem"] for s in one_items["slave"]]
  694. # stems += "<br/>".join(stem_l)
  695. chachong_item_dict = {"topic_id": id + 1,
  696. "subject_id": self.subject,
  697. "topic_type_id": one_items["checkType"]["id"],
  698. "content": stems}
  699. if "slave" in one_items:
  700. chachong_item_dict["slave"] = one_items["slave"]
  701. if "options" in one_items:
  702. chachong_item_dict["options"] = one_items["options"]
  703. # print(chachong_item_dict)
  704. try:
  705. repeat_r = requests.post(url=configs.repeat_ip, json=[chachong_item_dict]).json()
  706. print("查重结果:", repeat_r) # [str(id + 1)]
  707. if repeat_r:
  708. repeat_r = repeat_r[str(id + 1)]
  709. else:
  710. repeat_r = []
  711. except Exception as e:
  712. logger.info("----【paper_id:{}】查重服务异常:{}".format(self.wordid, e))
  713. repeat_r = "保存入库查重服务异常"
  714. repeat_time += time.time() - t22
  715. return repeat_r, repeat_time
  716. def callback_user(self, res_xbk, callback_url, err=""):
  717. """全学科题库、第三方上传试卷回调"""
  718. have_err = 0
  719. if not err:
  720. if res_xbk["errcode"]:
  721. have_err = 1
  722. logger.info(json.dumps({"log_level": "info",
  723. "paper_id": self.wordid,
  724. "status": "入库失败",
  725. "errmsg": res_xbk["errmsg"],
  726. "task_name": "保存入库"}, ensure_ascii=False))
  727. else:
  728. logger.info(json.dumps({"log_level": "info",
  729. "paper_id": self.wordid,
  730. "status": "入库成功",
  731. "task_name": "保存入库"}, ensure_ascii=False))
  732. try:
  733. r = requests.post(callback_url,
  734. # json=res, # 可以,但是会进行转义
  735. headers={"Content-Type":"application/json"},
  736. data=json.dumps(res_xbk, ensure_ascii=False).encode("utf-8"), # 文件开头有编码显示
  737. )
  738. print("------【paper_id:{}】,post 回调地址状态:{}===>回调结果: {} -------\n".format(self.wordid, r.status_code, r.text))
  739. if r.status_code != 200:
  740. have_err = 1
  741. if r.text != "解析完成!":
  742. have_err = 1
  743. logger.info(json.dumps(
  744. {"log_level": "info",
  745. "paper_id": self.wordid,
  746. "callback_res": {"status": "回调成功" if r.status_code == 200 else "回调失败",
  747. "status_code": r.status_code,
  748. "text": str(r.text),
  749. "callback_url": callback_url},
  750. "task_name": "入库回调"}, ensure_ascii=False))
  751. # except TimeoutError:
  752. # # print("回调超时")
  753. # callback_err += "回调超时"
  754. # logger.info("------【paper_id:{}】回调超时-------".format(self.wordid))
  755. except Exception as e:
  756. self.callback_err += "回调出错"
  757. self.callback_code = 1
  758. have_err = 1
  759. print("------【paper_id:{}】回调出错:{}-------".format(self.wordid, e))
  760. logger.info(json.dumps(
  761. {"log_level": "warn",
  762. "paper_id": self.wordid,
  763. "callback_res": {"status": "回调失败",
  764. "callback_url": callback_url},
  765. "errmsg": str(e),
  766. "task_name": "入库回调"}, ensure_ascii=False))
  767. else:
  768. if r.status_code != 200:
  769. have_err = 1
  770. self.callback_code = 1
  771. self.callback_err = "回调出错:{}".format(r.status_code)
  772. logger.info(json.dumps(
  773. {"log_level": "warn",
  774. "paper_id": self.wordid,
  775. "callback_res": {"status": "回调失败",
  776. "status_code": r.status_code,
  777. "text": r.text,
  778. "callback_url": callback_url},
  779. "task_name": "入库回调"}, ensure_ascii=False))
  780. return have_err
  781. def callback_php(self, res_xbk):
  782. """
  783. 将解析校对完的试题返回数据库端
  784. :param res_xbk: 返回给其它端的数据
  785. :return:
  786. """
  787. if res_xbk["errmsg"] not in ["ok", "保存失败"]: #公式上传腾讯云失败等
  788. self.callback_err += res_xbk["errmsg"]
  789. if self.callback_err:
  790. self.callback_code = 1
  791. type_check = {"errcode": self.callback_code,
  792. "errmsg": self.callback_err,
  793. "parseId": self.wordid,
  794. "callback_type": 2,
  795. "data": [k["checkType"]["id"] for k in self.items_list],
  796. }
  797. try:
  798. r2 = requests.post(configs.callback_url_taskcheck,
  799. data=json.dumps(type_check, ensure_ascii=False).encode("utf-8"))
  800. print("------【paper_id:{}】taskcheck post数据:{} 回调地址状态:{}===>回调结果: {}-------".format(
  801. self.wordid, type_check, r2.status_code, r2.text))
  802. logger.info(json.dumps({"log_level": "info",
  803. "paper_id": self.wordid,
  804. "callback_data": type_check,
  805. "callback_res": {"status": "回调成功" if r2.status_code == 200 else "回调失败",
  806. "status_code": r2.status_code,
  807. "text": r2.text,
  808. "callback_url": configs.callback_url_taskcheck},
  809. "task_name": "入库回调"}, ensure_ascii=False))
  810. except Exception as e:
  811. print("------【paper_id:{}】taskcheck回调出错:{}-------".format(self.wordid, e))
  812. logger.info(json.dumps({"log_level": "warn",
  813. "paper_id": self.wordid,
  814. "callback_data": type_check,
  815. "callback_res": {"status": "回调失败",
  816. "callback_url": configs.callback_url_taskcheck},
  817. "errmsg": str(e),
  818. "task_name": "入库回调"}, ensure_ascii=False))
  819. else:
  820. if r2.status_code != 200:
  821. print("------【paper_id:{}】taskcheck回调出错:{}".format(self.wordid, r2.status_code))
  822. logger.info(json.dumps({"log_level": "warn",
  823. "paper_id": self.wordid,
  824. "callback_data": type_check,
  825. "callback_res": {"status": "回调失败",
  826. "status_code": r2.status_code,
  827. "text": r2.text,
  828. "callback_url": configs.callback_url_taskcheck},
  829. "task_name": "入库回调"}, ensure_ascii=False))
  830. if __name__ == '__main__':
  831. from pprint import pprint
  832. import pickle
  833. # items_list = [{'id': '60bdcd734a5335001b0a73cf', 'type': '填空题',
  834. # 'stem': '在数列\\({\\lbrace a_{n}\\rbrace }\\)中,若\\({a_{1}=1,a_{n}-a_{n-1}=n(n\\geq 2),}\\)则该数列的通项\\({a_{n}=}\\)',
  835. # 'options': [], 'key': '\\( \\frac{1}{2} \\) \n ',
  836. # 'subject': '数学', 'errmsgs': '', 'topic_num': 0, 'parse_img': '略', 'analysis': '', 'slave_img': '',
  837. # 'parse': '略 \n \n ', 'category': ['月考'], 'grade': '高一',
  838. # 'stem_img': "<img src='http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/imgpaper/lqy_upload/img_5fc0d256407550d0b7d9a43c_56.png' width='305' height='18' />", 'period': '高中',
  839. # 'province': '湖北', 'susp_pic': None, 'option_str': '', 'blank_num': None, 'year': 2020, 'difficulty': '中',
  840. # 'specials': [], 'upload_time': '2021-07-16T13:51:49.561000Z',
  841. # 'key_img': "<img src='http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/imgpaper/lqy_upload/ans_img_5fc0d256407550d0b7d9a43c_0.png' width='106' height='17' />", 'options_img': [],
  842. # 'options_rank': None, 'text_status': None, 'img_status': 1,
  843. # 'source': {'type': 's',
  844. # 'related_exampaper': [{'paper_id': '5fc0d256407550d0b7d9a43c',
  845. # 'file_name': '十堰市一中 2019 级高一下4月月考 数学试题包含答案 ',
  846. # 'item_id': None}]}}]
  847. # ocr_html = r'数学<br/>命题人:王旭辉<br/>一、选择题(本大题共12小题,每小题5分,请将正确答案填涂在答题卡相应的位置。)<br/>1.cos80°sin40°+sin50°cos10°的值为()<br/>A.${\quad \frac{1}{2}}$B.${\quad \frac{\sqrt {2}}{2}}${c.\quad \frac{\sqrt {3}}{2}}${b.\quad -\frac{\sqrt {3}}{2}}$<br/>2.已知在等比数列${\lbrace a_{n}\rbrace }$中,${a_{1}=1,\quad a_{5}=9,}${a_{3}=(\quad }$<br/>B.±5.±3D.3<br/>3.已知a>b>0,则下列不等式成立的是()<br/>A.${\quad a>b>\frac{a+b}{2}>\sqrt {ab}}$B.${\quad a>\frac{a+b}{2}>\sqrt {ab}>b}$<br/>${c.\quad a>\frac{a+b}{2}>b>\sqrt {ab}}$D.${\quad a>\sqrt {ab}>\frac{a+b}{2}>b}$<br/>4.给出下列命题:<br/>①棱柱的侧棱都相等,侧面都是全等的平行四边形;<br/>②用一个平面去截棱锥,棱锥底面与截面之间的部分是棱台;<br/>③半圆绕着它的直径所在的直线旋转一周所形成的曲面叫做球面;<br/>④棱台的侧棱延长后交于一点,侧面是等腰梯形.<br/>其中正确命题的序号是()<br/>A.①②④B.①②③C.②③).③<br/>5.已知向量a${i=(1,2),\vec {b}=(2,-2),\quad \vec {c}=(\lambda ,-1)}$,若${\vec {c}//(2\vec {a}+\vec {b})}$则λ=()<br/>A.-2B.-1${c.\quad -\frac{1}{2}}$D.${\quad \frac{1}{2}}$<br/>6.已知△ABC中,a=1,${b=\sqrt {3},}$A=30°,则B等于()<br/>A.30°B.30°或150°C.60°D.60°或120°<br/>7.在△ABC中,a、b、c分别为角A、B、C的对边,若b=2,c=1,C=30°,则a=()()<br/>A.${\quad \sqrt {3}}$B.3C.${\quad \sqrt {5}}$D.1<br/>8.若(a+b+c)(b+c-a)=3bc,且sinA=2sinBcosC,那么△ABC是()<br/>A.直角三角形B.等边三角形<br/>C.等腰三角形D.等腰直角三角形<br/>9.在等差数列${\lbrace a_{n}\rbrace }$中,${S_{15}>0,\quad S_{16}<0,}$则使${a_{n}>0}$成立的n的最大值为()<br/>A.6B.7C.8D.S<br/>10.已知等比数列${\lbrace a_{n}\rbrace }$的前n项和为${S_{n},}${S_{5}=2,\quad S_{10}=6,}${a_{16}+a_{17}+a_{18}+a_{19}+a_{20}=}$<br/>()<br/>A.54B.48C.32D.16<br/>11.设点D为△ABC中BC边上的中点,O为AD边上靠近点A的三等分点,则()<br/>A.${\quad \overrightarrow {BO}=-\frac{1}{6}\overrightarrow {AB}+\frac{1}{2}\overrightarrow {AC}}$B.${\quad \overrightarrow {BO}=\frac{1}{6}\overrightarrow {AB}-\frac{1}{2}\overrightarrow {AC}}$<br/>${\therefore \overrightarrow {BO}=\frac{5}{6}\overrightarrow {AB}-\frac{1}{6}\overrightarrow {AC}}$D.${\quad \overrightarrow {BO}=-\frac{5}{6}\overrightarrow {AB}+\frac{1}{6}\overrightarrow {AC}}$<br/>12.△ABC中,角A、B、C的对边分别为a、b、c,且2a+b=2ccosB,若△ABC的面<br/>积为${S=\sqrt {3}c,}$则ab的最小值为()<br/>A.12B.24C.28D.48<br/>二、填空题(本大题共4小题,每小题5分.请将正确答案填写在答题卡相应位置。)<br/>13.在数列${\lbrace a_{n}\rbrace }$中,若${a_{1}=1,a_{n}-a_{n-1}=n(n\geq 2),}$则该数列的通项${a_{n}=}$<br/>14.已知圆锥的侧面展开图是一个半径为6cm,圆心角为${\frac{2\pi}{3}}$的扇形,则此圆锥的体积为<br/>15.已知平面向量${\vec {a}}${\vec {b}}$的夹角为${\frac{\pi}{3},\quad \vec {a}=(\sqrt {3},-1),\quad |\vec {b}|=1,}$则|${2\vec {a}-\vec {b}|=}$<br/>16.已知α、β为锐角,sinα=2,tan(β-α)=-,则tanβ=______<br/>三.解答题(本大题共6小题,共70分.请将正确答案写在答题卡相应位置。解答应写出<br/>文字说明、证明过程或演算步骤.)<br/>17.(10分)(1)解不等式(x-1)(x-a)≥0<br/>(2)已知${f(x)=\frac{x^{2}+6x+9}{x+1},}$其中x>-1,求f(x)的最小值.<br/>18.(12分)已知函数j${{(x)=2\sin x\cos (x+\frac{\pi}{3})+\frac{\sqrt {3}}{2}}}$<br/>(1)求函数f(x)的最小正周期;<br/>(2)若f(x)+m≤0对${x\∈\lbrack 0,\frac{\pi}{2}\rbrack }$亘成立,求实数m的取值范围.<br/>19.(12分)已知等比数列${\lbrace a_{n}\rbrace }$的前n项和为${S_{n},}$且满足${S_{3}=7,\quad S_{6}=63,}$<br/>(1)求数列${\lbrace a_{n}\rbrace }$的通项公式;<br/>(2)若${b_{n}=a_{n}+\log _{2}a_{n},}$求数列${\lbrace b_{n}\rbrace }$的前n项和${T_{n}}$<br/>0.(12分)已知数列${\lbrace a_{n}\rbrace }$满足${a_{1}=\frac{3}{2},}${l_{n}=\frac{a_{n-1}}{2}+\frac{1}{2^{n-1}}(n\geq 2,n\∈N^{*})}$<br/>(1)求证:数列${\lbrace 2^{n}a_{n}\rbrace }$是等差数列,并求出数列${\lbrace a_{n}\rbrace }$的通项公式;<br/>(2)求数列${\lbrace a_{n}\rbrace }$的前n项和${S_{n}.}$<br/>21.(12分)如图,在△ABC中,${C=\frac{\pi}{4},\overrightarrow {CA}\cdot \overrightarrow {CB}=48,}$点D在BC边上,且<br/>${AD=5\sqrt {2},\cos \angle ADB=\frac{3}{5}}$<br/>(I)求AC,CD的长;(II)求cos∠BAD的值.<br/>22.(12分)数列{a,}中,a,=1,当n≥2时,其前n项和S,满足S,2=a,(S,--)${(u_{n})^{\prime }//t_{1},\quad u_{1}-}${4b_{n}//A_{n}-u_{n}\cdot (\beta _{n}-\bar {2})}$<br/>(1)求${S_{n}}$的表达式;<br/>(2)求数列${\lbrace a_{n}\rbrace }$的通项公式;<br/>(3)设${b_{n}=\frac{S_{n}}{2n+1}.}$求数列${\lbrace b_{n}\rbrace }$的前n项和${T_{n}.}$<br/>数学答案<br/>一、选择题<br/>二、填空题<br/>${13.\frac{n^{2}+n}{2}\quad 14.\frac{16\sqrt {2}}{3}\pi\quad 15.\sqrt {13}\quad 16.\frac{73}{9}}$<br/>三、解答题<br/>17.(1)当a>1时,原不等式解集是{x|x≥a,或x≤1};<br/>当a=1时,原不等式解集是R:<br/>当a<1时,原不等式解集是(x|x|1或X]a}_5分<br/>(2)∵x>-1,则x+1>0,<br/>由基本不等式得${f(x)=\frac{x^{2}+6x+9}{x+1}=}$+1x+1${(x+1)+\frac{4}{x+i}+4}$<br/>${=2\sqrt {(x+1)\cdot \frac{4}{x+1}}+4=8}$(当且仅当${x+1=\frac{4}{x+1}}$时,即当x=1时取得等号)<br/>因此,函数${f(x)=\frac{x^{2}+6x+9}{x+1}(x>-1}$)的最小值为810分<br/>18.解:(1)因为${f(x)=2\sin x\cos (x+}$<br/>${=2\sin x(\cos x\cos \frac{\pi}{3}-\sin x\sin x\sin }$<br/>${=2\sin x(\frac{1}{2}\cos x-\frac{\sqrt {3}}{2}\sin x}$<br/>${\div \sin x\cos x-\sqrt {3}\sin ^{2}x+\frac{\sqrt {3}}{2}}$<br/>${=\frac{1}{2}\sin 2x+\frac{\sqrt {3}}{2}\cos 2x}$<br/>${=\sin (2x+\frac{\pi}{3})}$<br/>所以f(x)的最小正周期为${f=\frac{2\pi}{2}=\pi}$<br/>(2)"f(x)+m≤0对${x\∈\lbrack 0,\frac{\pi}{2}\rbrack }$恒成立"等价于"${f(x)_{\max }+m\leq 0^{n}}$<br/>因为${x\∈\lbrack 0,\frac{\pi}{2}\rbrack }$<br/>所以${2x+\frac{\pi}{3}\∈\lbrack \frac{\pi}{3},\frac{4\pi}{3}\rbrack }$<br/>${2x+\frac{\pi}{3}=\frac{\pi}{2},}${x=\frac{\pi}{12}}$<br/>f(x)的最大值为${f(\frac{\pi}{12})=1.}$<br/>所以实数m的取值范围为${(-9O,-1\rbrack }$12分<br/>19.(1)由题意知S${\because _{6}\neq 2s_{3},q\neq 1\cdots }$<br/>${\therefore S_{3}=\frac{a_{1}(7-q^{3})}{1-q}=7}$<br/>........................3分<br/>${s_{6}=\frac{a_{1}(1-q^{6})}{1-q}}$<br/>解得${\left\lbrace \begin{array}{l}{a_{1}=7}\\{q=2}\end{array}\right.\cdots \cdots }$5分${\therefore a_{n}=2^{n-7}\cdots \cdots }$.6分<br/>2)由(1)知${b_{n}=2^{n-7}+n-1\cdots \cdots \cdots }$..7分<br/>∴T。=(1+2+-..+${y^{-x-3}_{n}}$+[1+2+--+(n-1)].................9分<br/>${=2^{n}+\frac{n^{2}-n}{2}-1\cdots }$.........12分<br/>20.(1)因为${a_{n}=\frac{a_{n-1}}{2}+\frac{1}{2^{n-1}}(n\geq 2,n\∈N^{*})}$,所以${2^{n}a_{n}=2^{n-1}a_{a}+2}$,即<br/>${2^{n}a_{n}-2^{n-1}a_{n-1}=2,}$<br/>所以数列${\lbrace 2^{n}a_{n}\rbrace }$是等差数列,且公差d=2,其首项${2a_{1}=3}$<br/>所以${2^{7}a_{n}=3+(n-1)\times 2=2n+7}$,解得${a_{n}=\frac{2n+i}{2^{n}}}$<br/>${2)\quad S_{n}=\frac{3}{2}+\frac{5}{2^{2}}+\frac{7}{2^{3}}+\cdots +\frac{2n-1}{2^{p-1}}+\frac{2n+1}{z^{\theta }},}$<br/>${\frac{S_{n}}{2}=\frac{3}{2^{2}}+\frac{5}{2^{3}}+\frac{7}{2^{4}}+\cdots +\frac{2n-1}{2^{n}}+\frac{2n+1}{2^{n}+1},}$<br/>①-②,得${\frac{S_{e}}{z}=\frac{3}{z}+}${+\frac{7}{2^{3}}+\cdots +\frac{1}{2^{s}}}${=\frac{3}{2}+}${z^{e}+x^{2}}$ ${1-\frac{7}{2}}$<br/>${=\frac{5}{x}-\frac{2n+5}{a+1},}$<br/>所以${S_{n}=5-\frac{2n+5}{2^{n}}}$12分<br/>21.(I)在△ABD中,∵${\cos \angle ADB=\frac{3}{5},\therefore \sin \angle ADB=\frac{4}{5}.}$<br/>sin∠CAD=sin(∠ADB-${\angle AcD,=\sin \angle ADB\cos \frac{\pi}{4}-\cos \angle ADB\sin \frac{\pi}{4}}$<br/>${=\frac{4}{5}\times \frac{\sqrt {2}}{2}-\frac{3}{5}\times \frac{\sqrt {2}}{2}=\frac{\sqrt {2}}{10}}$<br/>在△ADC中,由正弦定理得${\frac{Ac}{\sin \angle ADc}=\frac{cD}{\sin \angle CAD}=\frac{AD}{\sin \angle ACD}}${\frac{AC}{\frac{4}{5}}=\frac{cD}{\sqrt {2}}=\frac{5\sqrt {2}}{\sqrt {2}}}$<br/>解得${AC=8,CD=\sqrt {2},}$<br/>${\Pi)\because \overrightarrow {CA}\cdot \overrightarrow {CB}=48,}${8\cdot cB\cdot \frac{\sqrt {2}}{2}=48.}$解得${c_{B}=6\sqrt {2},}$∴BD=CB-CD=5√2<br/>在△ABC中,A${B=\sqrt {8^{2}+(6\sqrt {2})-2\times 8\times 6\sqrt {2}}=2\sqrt {10}}$,在△ABD中<br/>${\infty \angle BAD=\frac{(2\sqrt {10})^{2}+(5\sqrt {2})}{2\times 2\sqrt {10}\times 5\sqrt {2}}=\frac{\sqrt {5}}{5}}$<br/>22.(1)由${\sin ^{2}=5}=S_{n}-5_{5}}&{T_{6}^{z}=-7}}${s_{w}^{2}=(S_{w}-S_{6-1})(s_{w}-\frac{1}{2})=s_{e}^{\vec {x}}-\frac{1}{2}S_{\varphi }-S_{6}=+\frac{7}{2}s}$<br/>${\therefore \frac{1}{s_{n}}-\frac{1}{S_{n-1}}=2(n\supseteq 2)}$<br/>${\therefore \left\lbrace \begin{array}{l}{\frac{1}{s}\rbrace }$是以${\frac{1}{s_{7}}}$为首项,以2为公差的等差数列,<br/>${\therefore \frac{1}{s_{n}}=2n-1,}$<br/>${s_{n}=\frac{1}{2n-1}(n\∈N^{*}.}$<br/>${a_{n}=\left\lbrace \begin{array}{l}{7,n=7}\\{\frac{1}{2p-1}-\frac{7}{2n-3},n\geq }\end{array}\right.}$<br/>(3)${b_{n}=\frac{7}{(2n-7)(2n+i)}=}$<br/>${\therefore 7_{8}=\frac{1}{2}(1-\frac{1}{3}+\frac{1}{3}-\frac{1}{5}+\frac{1}{2\pi-1}-\frac{1}{2\pi+1})=\frac{1}{2}(-\frac{1}{2n+1})=\frac{\pi}{2\pi}}$12/'
  848. # svg_data = {'svg_html_data': ['<div data-v-66982a76=""><div data-v-66982a76="" class="stem-wraper"><span data-v-66982a76="" class="topic-number">1.</span><span data-v-66982a76="" class="stem">在数列<span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax_SVG" id="MathJax-Element-121-Frame" tabindex="0" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><mrow class=&quot;MJX-TeXAtom-ORD&quot;><mo fence=&quot;false&quot; stretchy=&quot;false&quot;>{</mo><msub><mi>a</mi><mrow class=&quot;MJX-TeXAtom-ORD&quot;><mi>n</mi></mrow></msub><mo fence=&quot;false&quot; stretchy=&quot;false&quot;>}</mo></mrow></math>" role="presentation" style="font-size: 100%; display: inline-block; position: relative;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="4.773ex" height="2.66ex" viewBox="0 -832 2055.1 1145.2" role="img" focusable="false" style="vertical-align: -0.728ex;" aria-hidden="true"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><use xlink:href="#MJMAIN-7B" x="0" y="0"></use><g transform="translate(500,0)"><use xlink:href="#MJMATHI-61" x="0" y="0"></use><use transform="scale(0.707)" xlink:href="#MJMATHI-6E" x="748" y="-213"></use></g><use xlink:href="#MJMAIN-7D" x="1554" y="0"></use></g></svg><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow class="MJX-TeXAtom-ORD"><mo fence="false" stretchy="false">{</mo><msub><mi>a</mi><mrow class="MJX-TeXAtom-ORD"><mi>n</mi></mrow></msub><mo fence="false" stretchy="false">}</mo></mrow></math></span></span><script type="math/tex" id="MathJax-Element-121">{\\lbrace a_{n}\\rbrace }</script>中,若<span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax_SVG" id="MathJax-Element-122-Frame" tabindex="0" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><mrow class=&quot;MJX-TeXAtom-ORD&quot;><msub><mi>a</mi><mrow class=&quot;MJX-TeXAtom-ORD&quot;><mn>1</mn></mrow></msub><mo>=</mo><mn>1</mn><mo>,</mo><msub><mi>a</mi><mrow class=&quot;MJX-TeXAtom-ORD&quot;><mi>n</mi></mrow></msub><mo>&amp;#x2212;</mo><msub><mi>a</mi><mrow class=&quot;MJX-TeXAtom-ORD&quot;><mi>n</mi><mo>&amp;#x2212;</mo><mn>1</mn></mrow></msub><mo>=</mo><mi>n</mi><mo stretchy=&quot;false&quot;>(</mo><mi>n</mi><mo>&amp;#x2265;</mo><mn>2</mn><mo stretchy=&quot;false&quot;>)</mo><mo>,</mo></mrow></math>" role="presentation" style="font-size: 100%; display: inline-block; position: relative;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="30.021ex" height="2.66ex" viewBox="0 -832 12925.8 1145.2" role="img" focusable="false" style="vertical-align: -0.728ex;" aria-hidden="true"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><use xlink:href="#MJMATHI-61" x="0" y="0"></use><use transform="scale(0.707)" xlink:href="#MJMAIN-31" x="748" y="-213"></use><use xlink:href="#MJMAIN-3D" x="1261" y="0"></use><use xlink:href="#MJMAIN-31" x="2317" y="0"></use><use xlink:href="#MJMAIN-2C" x="2817" y="0"></use><g transform="translate(3263,0)"><use xlink:href="#MJMATHI-61" x="0" y="0"></use><use transform="scale(0.707)" xlink:href="#MJMATHI-6E" x="748" y="-213"></use></g><use xlink:href="#MJMAIN-2212" x="4539" y="0"></use><g transform="translate(5540,0)"><use xlink:href="#MJMATHI-61" x="0" y="0"></use><g transform="translate(529,-150)"><use transform="scale(0.707)" xlink:href="#MJMATHI-6E" x="0" y="0"></use><use transform="scale(0.707)" xlink:href="#MJMAIN-2212" x="600" y="0"></use><use transform="scale(0.707)" xlink:href="#MJMAIN-31" x="1379" y="0"></use></g></g><use xlink:href="#MJMAIN-3D" x="7776" y="0"></use><use xlink:href="#MJMATHI-6E" x="8832" y="0"></use><use xlink:href="#MJMAIN-28" x="9433" y="0"></use><use xlink:href="#MJMATHI-6E" x="9822" y="0"></use><use xlink:href="#MJMAIN-2265" x="10701" y="0"></use><use xlink:href="#MJMAIN-32" x="11757" y="0"></use><use xlink:href="#MJMAIN-29" x="12257" y="0"></use><use xlink:href="#MJMAIN-2C" x="12647" y="0"></use></g></svg><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow class="MJX-TeXAtom-ORD"><msub><mi>a</mi><mrow class="MJX-TeXAtom-ORD"><mn>1</mn></mrow></msub><mo>=</mo><mn>1</mn><mo>,</mo><msub><mi>a</mi><mrow class="MJX-TeXAtom-ORD"><mi>n</mi></mrow></msub><mo>−</mo><msub><mi>a</mi><mrow class="MJX-TeXAtom-ORD"><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msub><mo>=</mo><mi>n</mi><mo stretchy="false">(</mo><mi>n</mi><mo>≥</mo><mn>2</mn><mo stretchy="false">)</mo><mo>,</mo></mrow></math></span></span><script type="math/tex" id="MathJax-Element-122">{a_{1}=1,a_{n}-a_{n-1}=n(n\\geq 2),}</script>则该数列的通项<span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax_SVG" id="MathJax-Element-123-Frame" tabindex="0" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><mrow class=&quot;MJX-TeXAtom-ORD&quot;><msub><mi>a</mi><mrow class=&quot;MJX-TeXAtom-ORD&quot;><mi>n</mi></mrow></msub><mo>=</mo></mrow></math>" role="presentation" style="font-size: 100%; display: inline-block; position: relative;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="4.902ex" height="1.817ex" viewBox="0 -520.7 2110.4 782.1" role="img" focusable="false" style="vertical-align: -0.607ex;" aria-hidden="true"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><use xlink:href="#MJMATHI-61" x="0" y="0"></use><use transform="scale(0.707)" xlink:href="#MJMATHI-6E" x="748" y="-213"></use><use xlink:href="#MJMAIN-3D" x="1331" y="0"></use></g></svg><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow class="MJX-TeXAtom-ORD"><msub><mi>a</mi><mrow class="MJX-TeXAtom-ORD"><mi>n</mi></mrow></msub><mo>=</mo></mrow></math></span></span><script type="math/tex" id="MathJax-Element-123">{a_{n}=}</script></span></div><!----><div data-v-66982a76="" class="topic-analysis"><ul data-v-66982a76="" class="topic-analysis-items"><li data-v-66982a76="" class="topic-analysis-content"><span data-v-66982a76="" class="analysis-prefix">【答案】</span><span data-v-66982a76=""><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax_SVG" id="MathJax-Element-124-Frame" tabindex="0" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><mfrac><mn>1</mn><mn>2</mn></mfrac></math>" role="presentation" style="font-size: 100%; display: inline-block; position: relative;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="1.658ex" height="3.262ex" viewBox="0 -935.7 713.9 1404.6" role="img" focusable="false" style="vertical-align: -1.089ex;" aria-hidden="true"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g transform="translate(120,0)"><rect stroke="none" width="473" height="60" x="0" y="220"></rect><use transform="scale(0.707)" xlink:href="#MJMAIN-31" x="84" y="576"></use><use transform="scale(0.707)" xlink:href="#MJMAIN-32" x="84" y="-536"></use></g></g></svg><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mn>1</mn><mn>2</mn></mfrac></math></span></span><script type="math/tex" id="MathJax-Element-124"> \\frac{1}{2} </script> \n </span></li><li data-v-66982a76="" class="topic-analysis-content"><span data-v-66982a76="" class="analysis-prefix">【解析】</span><span data-v-66982a76="">略 \n \n </span></li></ul></div></div><!----><div data-v-66982a76="" class="handle-stem" style="display: none;"><div data-v-66982a76="" class="divider" style="width: 100%; height: 1px; background-color: rgb(220, 223, 230); margin: 5px 0px;"></div><div data-v-66982a76="" class="btns" style="display: flex; justify-content: flex-end;"><button data-v-66982a76="" type="button" class="el-button el-button--primary el-button--mini" style="margin-left: 10px;"><!----><i class="el-icon-edit"></i><span>编辑</span></button><button data-v-66982a76="" type="button" class="el-button el-button--danger el-button--mini"><!----><i class="el-icon-delete"></i><span>删除</span></button></div></div>'], 'svg_path': '<path stroke-width="1" id="MJMAIN-31" d="M213 578L200 573Q186 568 160 563T102 556H83V602H102Q149 604 189 617T245 641T273 663Q275 666 285 666Q294 666 302 660V361L303 61Q310 54 315 52T339 48T401 46H427V0H416Q395 3 257 3Q121 3 100 0H88V46H114Q136 46 152 46T177 47T193 50T201 52T207 57T213 61V578Z"></path><path stroke-width="1" id="MJMAIN-32" d="M109 429Q82 429 66 447T50 491Q50 562 103 614T235 666Q326 666 387 610T449 465Q449 422 429 383T381 315T301 241Q265 210 201 149L142 93L218 92Q375 92 385 97Q392 99 409 186V189H449V186Q448 183 436 95T421 3V0H50V19V31Q50 38 56 46T86 81Q115 113 136 137Q145 147 170 174T204 211T233 244T261 278T284 308T305 340T320 369T333 401T340 431T343 464Q343 527 309 573T212 619Q179 619 154 602T119 569T109 550Q109 549 114 549Q132 549 151 535T170 489Q170 464 154 447T109 429Z"></path><path stroke-width="1" id="MJMAIN-221A" d="M95 178Q89 178 81 186T72 200T103 230T169 280T207 309Q209 311 212 311H213Q219 311 227 294T281 177Q300 134 312 108L397 -77Q398 -77 501 136T707 565T814 786Q820 800 834 800Q841 800 846 794T853 782V776L620 293L385 -193Q381 -200 366 -200Q357 -200 354 -197Q352 -195 256 15L160 225L144 214Q129 202 113 190T95 178Z"></path><path stroke-width="1" id="MJMATHI-62" d="M73 647Q73 657 77 670T89 683Q90 683 161 688T234 694Q246 694 246 685T212 542Q204 508 195 472T180 418L176 399Q176 396 182 402Q231 442 283 442Q345 442 383 396T422 280Q422 169 343 79T173 -11Q123 -11 82 27T40 150V159Q40 180 48 217T97 414Q147 611 147 623T109 637Q104 637 101 637H96Q86 637 83 637T76 640T73 647ZM336 325V331Q336 405 275 405Q258 405 240 397T207 376T181 352T163 330L157 322L136 236Q114 150 114 114Q114 66 138 42Q154 26 178 26Q211 26 245 58Q270 81 285 114T318 219Q336 291 336 325Z"></path><path stroke-width="1" id="MJMAIN-2E" d="M78 60Q78 84 95 102T138 120Q162 120 180 104T199 61Q199 36 182 18T139 0T96 17T78 60Z"></path><path stroke-width="1" id="MJMAIN-2212" d="M84 237T84 250T98 270H679Q694 262 694 250T679 230H98Q84 237 84 250Z"></path><path stroke-width="1" id="MJMAIN-33" d="M127 463Q100 463 85 480T69 524Q69 579 117 622T233 665Q268 665 277 664Q351 652 390 611T430 522Q430 470 396 421T302 350L299 348Q299 347 308 345T337 336T375 315Q457 262 457 175Q457 96 395 37T238 -22Q158 -22 100 21T42 130Q42 158 60 175T105 193Q133 193 151 175T169 130Q169 119 166 110T159 94T148 82T136 74T126 70T118 67L114 66Q165 21 238 21Q293 21 321 74Q338 107 338 175V195Q338 290 274 322Q259 328 213 329L171 330L168 332Q166 335 166 348Q166 366 174 366Q202 366 232 371Q266 376 294 413T322 525V533Q322 590 287 612Q265 626 240 626Q208 626 181 615T143 592T132 580H135Q138 579 143 578T153 573T165 566T175 555T183 540T186 520Q186 498 172 481T127 463Z"></path><path stroke-width="1" id="MJMAIN-7B" d="M434 -231Q434 -244 428 -250H410Q281 -250 230 -184Q225 -177 222 -172T217 -161T213 -148T211 -133T210 -111T209 -84T209 -47T209 0Q209 21 209 53Q208 142 204 153Q203 154 203 155Q189 191 153 211T82 231Q71 231 68 234T65 250T68 266T82 269Q116 269 152 289T203 345Q208 356 208 377T209 529V579Q209 634 215 656T244 698Q270 724 324 740Q361 748 377 749Q379 749 390 749T408 750H428Q434 744 434 732Q434 719 431 716Q429 713 415 713Q362 710 332 689T296 647Q291 634 291 499V417Q291 370 288 353T271 314Q240 271 184 255L170 250L184 245Q202 239 220 230T262 196T290 137Q291 131 291 1Q291 -134 296 -147Q306 -174 339 -192T415 -213Q429 -213 431 -216Q434 -219 434 -231Z"></path><path stroke-width="1" id="MJMATHI-61" d="M33 157Q33 258 109 349T280 441Q331 441 370 392Q386 422 416 422Q429 422 439 414T449 394Q449 381 412 234T374 68Q374 43 381 35T402 26Q411 27 422 35Q443 55 463 131Q469 151 473 152Q475 153 483 153H487Q506 153 506 144Q506 138 501 117T481 63T449 13Q436 0 417 -8Q409 -10 393 -10Q359 -10 336 5T306 36L300 51Q299 52 296 50Q294 48 292 46Q233 -10 172 -10Q117 -10 75 30T33 157ZM351 328Q351 334 346 350T323 385T277 405Q242 405 210 374T160 293Q131 214 119 129Q119 126 119 118T118 106Q118 61 136 44T179 26Q217 26 254 59T298 110Q300 114 325 217T351 328Z"></path><path stroke-width="1" id="MJMATHI-6E" d="M21 287Q22 293 24 303T36 341T56 388T89 425T135 442Q171 442 195 424T225 390T231 369Q231 367 232 367L243 378Q304 442 382 442Q436 442 469 415T503 336T465 179T427 52Q427 26 444 26Q450 26 453 27Q482 32 505 65T540 145Q542 153 560 153Q580 153 580 145Q580 144 576 130Q568 101 554 73T508 17T439 -10Q392 -10 371 17T350 73Q350 92 386 193T423 345Q423 404 379 404H374Q288 404 229 303L222 291L189 157Q156 26 151 16Q138 -11 108 -11Q95 -11 87 -5T76 7T74 17Q74 30 112 180T152 343Q153 348 153 366Q153 405 129 405Q91 405 66 305Q60 285 60 284Q58 278 41 278H27Q21 284 21 287Z"></path><path stroke-width="1" id="MJMAIN-7D" d="M65 731Q65 745 68 747T88 750Q171 750 216 725T279 670Q288 649 289 635T291 501Q292 362 293 357Q306 312 345 291T417 269Q428 269 431 266T434 250T431 234T417 231Q380 231 345 210T298 157Q293 143 292 121T291 -28V-79Q291 -134 285 -156T256 -198Q202 -250 89 -250Q71 -250 68 -247T65 -230Q65 -224 65 -223T66 -218T69 -214T77 -213Q91 -213 108 -210T146 -200T183 -177T207 -139Q208 -134 209 3L210 139Q223 196 280 230Q315 247 330 250Q305 257 280 270Q225 304 212 352L210 362L209 498Q208 635 207 640Q195 680 154 696T77 713Q68 713 67 716T65 731Z"></path><path stroke-width="1" id="MJMAIN-3D" d="M56 347Q56 360 70 367H707Q722 359 722 347Q722 336 708 328L390 327H72Q56 332 56 347ZM56 153Q56 168 72 173H708Q722 163 722 153Q722 140 707 133H70Q56 140 56 153Z"></path><path stroke-width="1" id="MJMAIN-2C" d="M78 35T78 60T94 103T137 121Q165 121 187 96T210 8Q210 -27 201 -60T180 -117T154 -158T130 -185T117 -194Q113 -194 104 -185T95 -172Q95 -168 106 -156T131 -126T157 -76T173 -3V9L172 8Q170 7 167 6T161 3T152 1T140 0Q113 0 96 17Z"></path><path stroke-width="1" id="MJMAIN-35" d="M164 157Q164 133 148 117T109 101H102Q148 22 224 22Q294 22 326 82Q345 115 345 210Q345 313 318 349Q292 382 260 382H254Q176 382 136 314Q132 307 129 306T114 304Q97 304 95 310Q93 314 93 485V614Q93 664 98 664Q100 666 102 666Q103 666 123 658T178 642T253 634Q324 634 389 662Q397 666 402 666Q410 666 410 648V635Q328 538 205 538Q174 538 149 544L139 546V374Q158 388 169 396T205 412T256 420Q337 420 393 355T449 201Q449 109 385 44T229 -22Q148 -22 99 32T50 154Q50 178 61 192T84 210T107 214Q132 214 148 197T164 157Z"></path><path stroke-width="1" id="MJMAIN-39" d="M352 287Q304 211 232 211Q154 211 104 270T44 396Q42 412 42 436V444Q42 537 111 606Q171 666 243 666Q245 666 249 666T257 665H261Q273 665 286 663T323 651T370 619T413 560Q456 472 456 334Q456 194 396 97Q361 41 312 10T208 -22Q147 -22 108 7T68 93T121 149Q143 149 158 135T173 96Q173 78 164 65T148 49T135 44L131 43Q131 41 138 37T164 27T206 22H212Q272 22 313 86Q352 142 352 280V287ZM244 248Q292 248 321 297T351 430Q351 508 343 542Q341 552 337 562T323 588T293 615T246 625Q208 625 181 598Q160 576 154 546T147 441Q147 358 152 329T172 282Q197 248 244 248Z"></path><path stroke-width="1" id="MJMATHI-42" d="M231 637Q204 637 199 638T194 649Q194 676 205 682Q206 683 335 683Q594 683 608 681Q671 671 713 636T756 544Q756 480 698 429T565 360L555 357Q619 348 660 311T702 219Q702 146 630 78T453 1Q446 0 242 0Q42 0 39 2Q35 5 35 10Q35 17 37 24Q42 43 47 45Q51 46 62 46H68Q95 46 128 49Q142 52 147 61Q150 65 219 339T288 628Q288 635 231 637ZM649 544Q649 574 634 600T585 634Q578 636 493 637Q473 637 451 637T416 636H403Q388 635 384 626Q382 622 352 506Q352 503 351 500L320 374H401Q482 374 494 376Q554 386 601 434T649 544ZM595 229Q595 273 572 302T512 336Q506 337 429 337Q311 337 310 336Q310 334 293 263T258 122L240 52Q240 48 252 48T333 46Q422 46 429 47Q491 54 543 105T595 229Z"></path><path stroke-width="1" id="MJMAIN-B1" d="M56 320T56 333T70 353H369V502Q369 651 371 655Q376 666 388 666Q402 666 405 654T409 596V500V353H707Q722 345 722 333Q722 320 707 313H409V40H707Q722 32 722 20T707 0H70Q56 7 56 20T70 40H369V313H70Q56 320 56 333Z"></path><path stroke-width="1" id="MJMATHI-44" d="M287 628Q287 635 230 637Q207 637 200 638T193 647Q193 655 197 667T204 682Q206 683 403 683Q570 682 590 682T630 676Q702 659 752 597T803 431Q803 275 696 151T444 3L430 1L236 0H125H72Q48 0 41 2T33 11Q33 13 36 25Q40 41 44 43T67 46Q94 46 127 49Q141 52 146 61Q149 65 218 339T287 628ZM703 469Q703 507 692 537T666 584T629 613T590 629T555 636Q553 636 541 636T512 636T479 637H436Q392 637 386 627Q384 623 313 339T242 52Q242 48 253 48T330 47Q335 47 349 47T373 46Q499 46 581 128Q617 164 640 212T683 339T703 469Z"></path><path stroke-width="1" id="MJMAIN-3E" d="M84 520Q84 528 88 533T96 539L99 540Q106 540 253 471T544 334L687 265Q694 260 694 250T687 235Q685 233 395 96L107 -40H101Q83 -38 83 -20Q83 -19 83 -17Q82 -10 98 -1Q117 9 248 71Q326 108 378 132L626 250L378 368Q90 504 86 509Q84 513 84 520Z"></path><path stroke-width="1" id="MJMAIN-30" d="M96 585Q152 666 249 666Q297 666 345 640T423 548Q460 465 460 320Q460 165 417 83Q397 41 362 16T301 -15T250 -22Q224 -22 198 -16T137 16T82 83Q39 165 39 320Q39 494 96 585ZM321 597Q291 629 250 629Q208 629 178 597Q153 571 145 525T137 333Q137 175 145 125T181 46Q209 16 250 16Q290 16 318 46Q347 76 354 130T362 333Q362 478 354 524T321 597Z"></path><path stroke-width="1" id="MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path><path stroke-width="1" id="MJMATHI-41" d="M208 74Q208 50 254 46Q272 46 272 35Q272 34 270 22Q267 8 264 4T251 0Q249 0 239 0T205 1T141 2Q70 2 50 0H42Q35 7 35 11Q37 38 48 46H62Q132 49 164 96Q170 102 345 401T523 704Q530 716 547 716H555H572Q578 707 578 706L606 383Q634 60 636 57Q641 46 701 46Q726 46 726 36Q726 34 723 22Q720 7 718 4T704 0Q701 0 690 0T651 1T578 2Q484 2 455 0H443Q437 6 437 9T439 27Q443 40 445 43L449 46H469Q523 49 533 63L521 213H283L249 155Q208 86 208 74ZM516 260Q516 271 504 416T490 562L463 519Q447 492 400 412L310 260L413 259Q516 259 516 260Z"></path><path stroke-width="1" id="MJMAIN-34" d="M462 0Q444 3 333 3Q217 3 199 0H190V46H221Q241 46 248 46T265 48T279 53T286 61Q287 63 287 115V165H28V211L179 442Q332 674 334 675Q336 677 355 677H373L379 671V211H471V165H379V114Q379 73 379 66T385 54Q393 47 442 46H471V0H462ZM293 211V545L74 212L183 211H293Z"></path><path stroke-width="1" id="MJMAIN-3A" d="M78 370Q78 394 95 412T138 430Q162 430 180 414T199 371Q199 346 182 328T139 310T96 327T78 370ZM78 60Q78 84 95 102T138 120Q162 120 180 104T199 61Q199 36 182 18T139 0T96 17T78 60Z"></path><path stroke-width="1" id="MJMAIN-3B" d="M78 370Q78 394 95 412T138 430Q162 430 180 414T199 371Q199 346 182 328T139 310T96 327T78 370ZM78 60Q78 85 94 103T137 121Q202 121 202 8Q202 -44 183 -94T144 -169T118 -194Q115 -194 106 -186T95 -174Q94 -171 107 -155T137 -107T160 -38Q161 -32 162 -22T165 -4T165 4Q165 5 161 4T142 0Q110 0 94 18T78 60Z"></path><path stroke-width="1" id="MJMATHI-43" d="M50 252Q50 367 117 473T286 641T490 704Q580 704 633 653Q642 643 648 636T656 626L657 623Q660 623 684 649Q691 655 699 663T715 679T725 690L740 705H746Q760 705 760 698Q760 694 728 561Q692 422 692 421Q690 416 687 415T669 413H653Q647 419 647 422Q647 423 648 429T650 449T651 481Q651 552 619 605T510 659Q484 659 454 652T382 628T299 572T226 479Q194 422 175 346T156 222Q156 108 232 58Q280 24 350 24Q441 24 512 92T606 240Q610 253 612 255T628 257Q648 257 648 248Q648 243 647 239Q618 132 523 55T319 -22Q206 -22 128 53T50 252Z"></path><path stroke-width="1" id="MJMATHI-3BB" d="M166 673Q166 685 183 694H202Q292 691 316 644Q322 629 373 486T474 207T524 67Q531 47 537 34T546 15T551 6T555 2T556 -2T550 -11H482Q457 3 450 18T399 152L354 277L340 262Q327 246 293 207T236 141Q211 112 174 69Q123 9 111 -1T83 -12Q47 -12 47 20Q47 37 61 52T199 187Q229 216 266 252T321 306L338 322Q338 323 288 462T234 612Q214 657 183 657Q166 657 166 673Z"></path><path stroke-width="1" id="MJMAIN-36" d="M42 313Q42 476 123 571T303 666Q372 666 402 630T432 550Q432 525 418 510T379 495Q356 495 341 509T326 548Q326 592 373 601Q351 623 311 626Q240 626 194 566Q147 500 147 364L148 360Q153 366 156 373Q197 433 263 433H267Q313 433 348 414Q372 400 396 374T435 317Q456 268 456 210V192Q456 169 451 149Q440 90 387 34T253 -22Q225 -22 199 -14T143 16T92 75T56 172T42 313ZM257 397Q227 397 205 380T171 335T154 278T148 216Q148 133 160 97T198 39Q222 21 251 21Q302 21 329 59Q342 77 347 104T352 209Q352 289 347 316T329 361Q302 397 257 397Z"></path><path stroke-width="1" id="MJMAIN-25B3" d="M75 0L72 2Q69 3 67 5T62 11T59 20Q59 24 62 30Q65 37 245 370T428 707Q428 708 430 710T436 714T444 716Q451 716 455 712Q459 710 644 368L828 27V20Q828 7 814 0H75ZM610 347L444 653Q443 653 278 347T113 40H775Q775 42 610 347Z"></path><path stroke-width="1" id="MJMAIN-B0" d="M147 628Q147 669 179 692T244 715Q298 715 325 689T352 629Q352 592 323 567T249 542Q202 542 175 567T147 628ZM313 628Q313 660 300 669T259 678H253Q248 678 242 678T234 679Q217 679 207 674T192 659T188 644T187 629Q187 600 198 590Q210 579 250 579H265Q279 579 288 581T305 595T313 628Z"></path><path stroke-width="1" id="MJMAIN-37" d="M55 458Q56 460 72 567L88 674Q88 676 108 676H128V672Q128 662 143 655T195 646T364 644H485V605L417 512Q408 500 387 472T360 435T339 403T319 367T305 330T292 284T284 230T278 162T275 80Q275 66 275 52T274 28V19Q270 2 255 -10T221 -22Q210 -22 200 -19T179 0T168 40Q168 198 265 368Q285 400 349 489L395 552H302Q128 552 119 546Q113 543 108 522T98 479L95 458V455H55V458Z"></path><path stroke-width="1" id="MJMATHI-63" d="M34 159Q34 268 120 355T306 442Q362 442 394 418T427 355Q427 326 408 306T360 285Q341 285 330 295T319 325T330 359T352 380T366 386H367Q367 388 361 392T340 400T306 404Q276 404 249 390Q228 381 206 359Q162 315 142 235T121 119Q121 73 147 50Q169 26 205 26H209Q321 26 394 111Q403 121 406 121Q410 121 419 112T429 98T420 83T391 55T346 25T282 0T202 -11Q127 -11 81 37T34 159Z"></path><path stroke-width="1" id="MJMAIN-38" d="M70 417T70 494T124 618T248 666Q319 666 374 624T429 515Q429 485 418 459T392 417T361 389T335 371T324 363L338 354Q352 344 366 334T382 323Q457 264 457 174Q457 95 399 37T249 -22Q159 -22 101 29T43 155Q43 263 172 335L154 348Q133 361 127 368Q70 417 70 494ZM286 386L292 390Q298 394 301 396T311 403T323 413T334 425T345 438T355 454T364 471T369 491T371 513Q371 556 342 586T275 624Q268 625 242 625Q201 625 165 599T128 534Q128 511 141 492T167 463T217 431Q224 426 228 424L286 386ZM250 21Q308 21 350 55T392 137Q392 154 387 169T375 194T353 216T330 234T301 253T274 270Q260 279 244 289T218 306L210 311Q204 311 181 294T133 239T107 157Q107 98 150 60T250 21Z"></path><path stroke-width="1" id="MJMAIN-2B" d="M56 237T56 250T70 270H369V420L370 570Q380 583 389 583Q402 583 409 568V270H707Q722 262 722 250T707 230H409V-68Q401 -82 391 -82H389H387Q375 -82 369 -68V230H70Q56 237 56 250Z"></path><path stroke-width="1" id="MJMATHI-73" d="M131 289Q131 321 147 354T203 415T300 442Q362 442 390 415T419 355Q419 323 402 308T364 292Q351 292 340 300T328 326Q328 342 337 354T354 372T367 378Q368 378 368 379Q368 382 361 388T336 399T297 405Q249 405 227 379T204 326Q204 301 223 291T278 274T330 259Q396 230 396 163Q396 135 385 107T352 51T289 7T195 -10Q118 -10 86 19T53 87Q53 126 74 143T118 160Q133 160 146 151T160 120Q160 94 142 76T111 58Q109 57 108 57T107 55Q108 52 115 47T146 34T201 27Q237 27 263 38T301 66T318 97T323 122Q323 150 302 164T254 181T195 196T148 231Q131 256 131 289Z"></path><path stroke-width="1" id="MJMATHI-69" d="M184 600Q184 624 203 642T247 661Q265 661 277 649T290 619Q290 596 270 577T226 557Q211 557 198 567T184 600ZM21 287Q21 295 30 318T54 369T98 420T158 442Q197 442 223 419T250 357Q250 340 236 301T196 196T154 83Q149 61 149 51Q149 26 166 26Q175 26 185 29T208 43T235 78T260 137Q263 149 265 151T282 153Q302 153 302 143Q302 135 293 112T268 61T223 11T161 -11Q129 -11 102 10T74 74Q74 91 79 106T122 220Q160 321 166 341T173 380Q173 404 156 404H154Q124 404 99 371T61 287Q60 286 59 284T58 281T56 279T53 278T49 278T41 278H27Q21 284 21 287Z"></path><path stroke-width="1" id="MJMATHI-6F" d="M201 -11Q126 -11 80 38T34 156Q34 221 64 279T146 380Q222 441 301 441Q333 441 341 440Q354 437 367 433T402 417T438 387T464 338T476 268Q476 161 390 75T201 -11ZM121 120Q121 70 147 48T206 26Q250 26 289 58T351 142Q360 163 374 216T388 308Q388 352 370 375Q346 405 306 405Q243 405 195 347Q158 303 140 230T121 120Z"></path><path stroke-width="1" id="MJMATHI-53" d="M308 24Q367 24 416 76T466 197Q466 260 414 284Q308 311 278 321T236 341Q176 383 176 462Q176 523 208 573T273 648Q302 673 343 688T407 704H418H425Q521 704 564 640Q565 640 577 653T603 682T623 704Q624 704 627 704T632 705Q645 705 645 698T617 577T585 459T569 456Q549 456 549 465Q549 471 550 475Q550 478 551 494T553 520Q553 554 544 579T526 616T501 641Q465 662 419 662Q362 662 313 616T263 510Q263 480 278 458T319 427Q323 425 389 408T456 390Q490 379 522 342T554 242Q554 216 546 186Q541 164 528 137T492 78T426 18T332 -20Q320 -22 298 -22Q199 -22 144 33L134 44L106 13Q83 -14 78 -18T65 -22Q52 -22 52 -14Q52 -11 110 221Q112 227 130 227H143Q149 221 149 216Q149 214 148 207T144 186T142 153Q144 114 160 87T203 47T255 29T308 24Z"></path><path stroke-width="1" id="MJMATHI-4F" d="M740 435Q740 320 676 213T511 42T304 -22Q207 -22 138 35T51 201Q50 209 50 244Q50 346 98 438T227 601Q351 704 476 704Q514 704 524 703Q621 689 680 617T740 435ZM637 476Q637 565 591 615T476 665Q396 665 322 605Q242 542 200 428T157 216Q157 126 200 73T314 19Q404 19 485 98T608 313Q637 408 637 476Z"></path><path stroke-width="1" id="MJMATHI-6D" d="M21 287Q22 293 24 303T36 341T56 388T88 425T132 442T175 435T205 417T221 395T229 376L231 369Q231 367 232 367L243 378Q303 442 384 442Q401 442 415 440T441 433T460 423T475 411T485 398T493 385T497 373T500 364T502 357L510 367Q573 442 659 442Q713 442 746 415T780 336Q780 285 742 178T704 50Q705 36 709 31T724 26Q752 26 776 56T815 138Q818 149 821 151T837 153Q857 153 857 145Q857 144 853 130Q845 101 831 73T785 17T716 -10Q669 -10 648 17T627 73Q627 92 663 193T700 345Q700 404 656 404H651Q565 404 506 303L499 291L466 157Q433 26 428 16Q415 -11 385 -11Q372 -11 364 -4T353 8T350 18Q350 29 384 161L420 307Q423 322 423 345Q423 404 379 404H374Q288 404 229 303L222 291L189 157Q156 26 151 16Q138 -11 108 -11Q95 -11 87 -5T76 7T74 17Q74 30 112 181Q151 335 151 342Q154 357 154 369Q154 405 129 405Q107 405 92 377T69 316T57 280Q55 278 41 278H27Q21 284 21 287Z"></path><path stroke-width="1" id="MJMAIN-20D7" d="M-123 694Q-123 702 -118 708T-103 714Q-93 714 -88 706T-80 687T-67 660T-40 633Q-29 626 -29 615Q-29 606 -36 600T-53 590T-83 571T-121 531Q-135 516 -143 516T-157 522T-163 536T-152 559T-129 584T-116 595H-287L-458 596Q-459 597 -461 599T-466 602T-469 607T-471 615Q-471 622 -458 635H-99Q-123 673 -123 694Z"></path><path stroke-width="1" id="MJMATHI-3C0" d="M132 -11Q98 -11 98 22V33L111 61Q186 219 220 334L228 358H196Q158 358 142 355T103 336Q92 329 81 318T62 297T53 285Q51 284 38 284Q19 284 19 294Q19 300 38 329T93 391T164 429Q171 431 389 431Q549 431 553 430Q573 423 573 402Q573 371 541 360Q535 358 472 358H408L405 341Q393 269 393 222Q393 170 402 129T421 65T431 37Q431 20 417 5T381 -10Q370 -10 363 -7T347 17T331 77Q330 86 330 121Q330 170 339 226T357 318T367 358H269L268 354Q268 351 249 275T206 114T175 17Q164 -11 132 -11Z"></path><path stroke-width="1" id="MJMAIN-7C" d="M139 -249H137Q125 -249 119 -235V251L120 737Q130 750 139 750Q152 750 159 735V-235Q151 -249 141 -249H139Z"></path><path stroke-width="1" id="MJMATHI-66" d="M118 -162Q120 -162 124 -164T135 -167T147 -168Q160 -168 171 -155T187 -126Q197 -99 221 27T267 267T289 382V385H242Q195 385 192 387Q188 390 188 397L195 425Q197 430 203 430T250 431Q298 431 298 432Q298 434 307 482T319 540Q356 705 465 705Q502 703 526 683T550 630Q550 594 529 578T487 561Q443 561 443 603Q443 622 454 636T478 657L487 662Q471 668 457 668Q445 668 434 658T419 630Q412 601 403 552T387 469T380 433Q380 431 435 431Q480 431 487 430T498 424Q499 420 496 407T491 391Q489 386 482 386T428 385H372L349 263Q301 15 282 -47Q255 -132 212 -173Q175 -205 139 -205Q107 -205 81 -186T55 -132Q55 -95 76 -78T118 -61Q162 -61 162 -103Q162 -122 151 -136T127 -157L118 -162Z"></path><path stroke-width="1" id="MJMATHI-78" d="M52 289Q59 331 106 386T222 442Q257 442 286 424T329 379Q371 442 430 442Q467 442 494 420T522 361Q522 332 508 314T481 292T458 288Q439 288 427 299T415 328Q415 374 465 391Q454 404 425 404Q412 404 406 402Q368 386 350 336Q290 115 290 78Q290 50 306 38T341 26Q378 26 414 59T463 140Q466 150 469 151T485 153H489Q504 153 504 145Q504 144 502 134Q486 77 440 33T333 -11Q263 -11 227 52Q186 -10 133 -10H127Q78 -10 57 16T35 71Q35 103 54 123T99 143Q142 143 142 101Q142 81 130 66T107 46T94 41L91 40Q91 39 97 36T113 29T132 26Q168 26 194 71Q203 87 217 139T245 247T261 313Q266 340 266 352Q266 380 251 392T217 404Q177 404 142 372T93 290Q91 281 88 280T72 278H58Q52 284 52 289Z"></path><path stroke-width="1" id="MJMAIN-73" d="M295 316Q295 356 268 385T190 414Q154 414 128 401Q98 382 98 349Q97 344 98 336T114 312T157 287Q175 282 201 278T245 269T277 256Q294 248 310 236T342 195T359 133Q359 71 321 31T198 -10H190Q138 -10 94 26L86 19L77 10Q71 4 65 -1L54 -11H46H42Q39 -11 33 -5V74V132Q33 153 35 157T45 162H54Q66 162 70 158T75 146T82 119T101 77Q136 26 198 26Q295 26 295 104Q295 133 277 151Q257 175 194 187T111 210Q75 227 54 256T33 318Q33 357 50 384T93 424T143 442T187 447H198Q238 447 268 432L283 424L292 431Q302 440 314 448H322H326Q329 448 335 442V310L329 304H301Q295 310 295 316Z"></path><path stroke-width="1" id="MJMAIN-69" d="M69 609Q69 637 87 653T131 669Q154 667 171 652T188 609Q188 579 171 564T129 549Q104 549 87 564T69 609ZM247 0Q232 3 143 3Q132 3 106 3T56 1L34 0H26V46H42Q70 46 91 49Q100 53 102 60T104 102V205V293Q104 345 102 359T88 378Q74 385 41 385H30V408Q30 431 32 431L42 432Q52 433 70 434T106 436Q123 437 142 438T171 441T182 442H185V62Q190 52 197 50T232 46H255V0H247Z"></path><path stroke-width="1" id="MJMAIN-6E" d="M41 46H55Q94 46 102 60V68Q102 77 102 91T102 122T103 161T103 203Q103 234 103 269T102 328V351Q99 370 88 376T43 385H25V408Q25 431 27 431L37 432Q47 433 65 434T102 436Q119 437 138 438T167 441T178 442H181V402Q181 364 182 364T187 369T199 384T218 402T247 421T285 437Q305 442 336 442Q450 438 463 329Q464 322 464 190V104Q464 66 466 59T477 49Q498 46 526 46H542V0H534L510 1Q487 2 460 2T422 3Q319 3 310 0H302V46H318Q379 46 379 62Q380 64 380 200Q379 335 378 343Q372 371 358 385T334 402T308 404Q263 404 229 370Q202 343 195 315T187 232V168V108Q187 78 188 68T191 55T200 49Q221 46 249 46H265V0H257L234 1Q210 2 183 2T145 3Q42 3 33 0H25V46H41Z"></path><path stroke-width="1" id="MJMAIN-63" d="M370 305T349 305T313 320T297 358Q297 381 312 396Q317 401 317 402T307 404Q281 408 258 408Q209 408 178 376Q131 329 131 219Q131 137 162 90Q203 29 272 29Q313 29 338 55T374 117Q376 125 379 127T395 129H409Q415 123 415 120Q415 116 411 104T395 71T366 33T318 2T249 -11Q163 -11 99 53T34 214Q34 318 99 383T250 448T370 421T404 357Q404 334 387 320Z"></path><path stroke-width="1" id="MJMAIN-6F" d="M28 214Q28 309 93 378T250 448Q340 448 405 380T471 215Q471 120 407 55T250 -10Q153 -10 91 57T28 214ZM250 30Q372 30 372 193V225V250Q372 272 371 288T364 326T348 362T317 390T268 410Q263 411 252 411Q222 411 195 399Q152 377 139 338T126 246V226Q126 130 145 91Q177 30 250 30Z"></path><path stroke-width="1" id="MJMAIN-5C" d="M56 731Q56 740 62 745T75 750Q85 750 92 740Q96 733 270 255T444 -231Q444 -239 438 -244T424 -250Q414 -250 407 -240Q404 -236 230 242T56 731Z"></path><path stroke-width="1" id="MJMAIN-2208" d="M84 250Q84 372 166 450T360 539Q361 539 377 539T419 540T469 540H568Q583 532 583 520Q583 511 570 501L466 500Q355 499 329 494Q280 482 242 458T183 409T147 354T129 306T124 272V270H568Q583 262 583 250T568 230H124V228Q124 207 134 177T167 112T231 48T328 7Q355 1 466 0H570Q583 -10 583 -20Q583 -32 568 -40H471Q464 -40 446 -40T417 -41Q262 -41 172 45Q84 127 84 250Z"></path><path stroke-width="1" id="MJMAIN-5B" d="M118 -250V750H255V710H158V-210H255V-250H118Z"></path><path stroke-width="1" id="MJMAIN-5D" d="M22 710V750H159V-250H22V-210H119V710H22Z"></path><path stroke-width="1" id="MJMAIN-6C" d="M42 46H56Q95 46 103 60V68Q103 77 103 91T103 124T104 167T104 217T104 272T104 329Q104 366 104 407T104 482T104 542T103 586T103 603Q100 622 89 628T44 637H26V660Q26 683 28 683L38 684Q48 685 67 686T104 688Q121 689 141 690T171 693T182 694H185V379Q185 62 186 60Q190 52 198 49Q219 46 247 46H263V0H255L232 1Q209 2 183 2T145 3T107 3T57 1L34 0H26V46H42Z"></path><path stroke-width="1" id="MJMAIN-67" d="M329 409Q373 453 429 453Q459 453 472 434T485 396Q485 382 476 371T449 360Q416 360 412 390Q410 404 415 411Q415 412 416 414V415Q388 412 363 393Q355 388 355 386Q355 385 359 381T368 369T379 351T388 325T392 292Q392 230 343 187T222 143Q172 143 123 171Q112 153 112 133Q112 98 138 81Q147 75 155 75T227 73Q311 72 335 67Q396 58 431 26Q470 -13 470 -72Q470 -139 392 -175Q332 -206 250 -206Q167 -206 107 -175Q29 -140 29 -75Q29 -39 50 -15T92 18L103 24Q67 55 67 108Q67 155 96 193Q52 237 52 292Q52 355 102 398T223 442Q274 442 318 416L329 409ZM299 343Q294 371 273 387T221 404Q192 404 171 388T145 343Q142 326 142 292Q142 248 149 227T179 192Q196 182 222 182Q244 182 260 189T283 207T294 227T299 242Q302 258 302 292T299 343ZM403 -75Q403 -50 389 -34T348 -11T299 -2T245 0H218Q151 0 138 -6Q118 -15 107 -34T95 -74Q95 -84 101 -97T122 -127T170 -155T250 -167Q319 -167 361 -139T403 -75Z"></path><path stroke-width="1" id="MJMATHI-54" d="M40 437Q21 437 21 445Q21 450 37 501T71 602L88 651Q93 669 101 677H569H659Q691 677 697 676T704 667Q704 661 687 553T668 444Q668 437 649 437Q640 437 637 437T631 442L629 445Q629 451 635 490T641 551Q641 586 628 604T573 629Q568 630 515 631Q469 631 457 630T439 622Q438 621 368 343T298 60Q298 48 386 46Q418 46 427 45T436 36Q436 31 433 22Q429 4 424 1L422 0Q419 0 415 0Q410 0 363 1T228 2Q99 2 64 0H49Q43 6 43 9T45 27Q49 40 55 46H83H94Q174 46 189 55Q190 56 191 56Q196 59 201 76T241 233Q258 301 269 344Q339 619 339 625Q339 630 310 630H279Q212 630 191 624Q146 614 121 583T67 467Q60 445 57 441T43 437H40Z"></path><path stroke-width="1" id="MJMATHI-49" d="M43 1Q26 1 26 10Q26 12 29 24Q34 43 39 45Q42 46 54 46H60Q120 46 136 53Q137 53 138 54Q143 56 149 77T198 273Q210 318 216 344Q286 624 286 626Q284 630 284 631Q274 637 213 637H193Q184 643 189 662Q193 677 195 680T209 683H213Q285 681 359 681Q481 681 487 683H497Q504 676 504 672T501 655T494 639Q491 637 471 637Q440 637 407 634Q393 631 388 623Q381 609 337 432Q326 385 315 341Q245 65 245 59Q245 52 255 50T307 46H339Q345 38 345 37T342 19Q338 6 332 0H316Q279 2 179 2Q143 2 113 2T65 2T43 1Z"></path><path stroke-width="1" id="MJMAIN-2220" d="M71 0L68 2Q65 3 63 5T58 11T55 20Q55 22 57 28Q67 43 346 361Q397 420 474 508Q595 648 616 671T647 694T661 688T666 674Q666 668 663 663Q662 662 627 622T524 503T390 350L120 41L386 40H653Q666 30 666 20Q666 8 651 0H71Z"></path><path stroke-width="1" id="MJMAIN-2265" d="M83 616Q83 624 89 630T99 636Q107 636 253 568T543 431T687 361Q694 356 694 346T687 331Q685 329 395 192L107 56H101Q83 58 83 76Q83 77 83 79Q82 86 98 95Q117 105 248 167Q326 204 378 228L626 346L360 472Q291 505 200 548Q112 589 98 597T83 616ZM84 -118Q84 -108 99 -98H678Q694 -104 694 -118Q694 -130 679 -138H98Q84 -131 84 -118Z"></path><path stroke-width="1" id="MJMAIN-2F" d="M423 750Q432 750 438 744T444 730Q444 725 271 248T92 -240Q85 -250 75 -250Q68 -250 62 -245T56 -231Q56 -221 230 257T407 740Q411 750 423 750Z"></path><path stroke-width="1" id="MJMATHI-75" d="M21 287Q21 295 30 318T55 370T99 420T158 442Q204 442 227 417T250 358Q250 340 216 246T182 105Q182 62 196 45T238 27T291 44T328 78L339 95Q341 99 377 247Q407 367 413 387T427 416Q444 431 463 431Q480 431 488 421T496 402L420 84Q419 79 419 68Q419 43 426 35T447 26Q469 29 482 57T512 145Q514 153 532 153Q551 153 551 144Q550 139 549 130T540 98T523 55T498 17T462 -8Q454 -10 438 -10Q372 -10 347 46Q345 45 336 36T318 21T296 6T267 -6T233 -11Q189 -11 155 7Q103 38 103 113Q103 170 138 262T173 379Q173 380 173 381Q173 390 173 393T169 400T158 404H154Q131 404 112 385T82 344T65 302T57 280Q55 278 41 278H27Q21 284 21 287Z"></path><path stroke-width="1" id="MJMAIN-22C5" d="M78 250Q78 274 95 292T138 310Q162 310 180 294T199 251Q199 226 182 208T139 190T96 207T78 250Z"></path><path stroke-width="1" id="MJMATHI-3B2" d="M29 -194Q23 -188 23 -186Q23 -183 102 134T186 465Q208 533 243 584T309 658Q365 705 429 705H431Q493 705 533 667T573 570Q573 465 469 396L482 383Q533 332 533 252Q533 139 448 65T257 -10Q227 -10 203 -2T165 17T143 40T131 59T126 65L62 -188Q60 -194 42 -194H29ZM353 431Q392 431 427 419L432 422Q436 426 439 429T449 439T461 453T472 471T484 495T493 524T501 560Q503 569 503 593Q503 611 502 616Q487 667 426 667Q384 667 347 643T286 582T247 514T224 455Q219 439 186 308T152 168Q151 163 151 147Q151 99 173 68Q204 26 260 26Q302 26 349 51T425 137Q441 171 449 214T457 279Q457 337 422 372Q380 358 347 358H337Q258 358 258 389Q258 396 261 403Q275 431 353 431Z"></path><path stroke-width="1" id="MJMAIN-AF" d="M69 544V590H430V544H69Z"></path><path stroke-width="1" id="MJSZ2-221A" d="M1001 1150Q1017 1150 1020 1132Q1020 1127 741 244L460 -643Q453 -650 436 -650H424Q423 -647 423 -645T421 -640T419 -631T415 -617T408 -594T399 -560T385 -512T367 -448T343 -364T312 -259L203 119L138 41L111 67L212 188L264 248L472 -474L983 1140Q988 1150 1001 1150Z"></path><path stroke-width="1" id="MJMAIN-F7" d="M318 466Q318 500 339 518T386 537Q418 537 438 517T458 466Q458 438 440 417T388 396Q355 396 337 417T318 466ZM56 237T56 250T70 270H706Q721 262 721 250T706 230H70Q56 237 56 250ZM318 34Q318 68 339 86T386 105Q418 105 438 85T458 34Q458 6 440 -15T388 -36Q355 -36 337 -15T318 34Z"></path><path stroke-width="1" id="MJMAIN-6D" d="M41 46H55Q94 46 102 60V68Q102 77 102 91T102 122T103 161T103 203Q103 234 103 269T102 328V351Q99 370 88 376T43 385H25V408Q25 431 27 431L37 432Q47 433 65 434T102 436Q119 437 138 438T167 441T178 442H181V402Q181 364 182 364T187 369T199 384T218 402T247 421T285 437Q305 442 336 442Q351 442 364 440T387 434T406 426T421 417T432 406T441 395T448 384T452 374T455 366L457 361L460 365Q463 369 466 373T475 384T488 397T503 410T523 422T546 432T572 439T603 442Q729 442 740 329Q741 322 741 190V104Q741 66 743 59T754 49Q775 46 803 46H819V0H811L788 1Q764 2 737 2T699 3Q596 3 587 0H579V46H595Q656 46 656 62Q657 64 657 200Q656 335 655 343Q649 371 635 385T611 402T585 404Q540 404 506 370Q479 343 472 315T464 232V168V108Q464 78 465 68T468 55T477 49Q498 46 526 46H542V0H534L510 1Q487 2 460 2T422 3Q319 3 310 0H302V46H318Q379 46 379 62Q380 64 380 200Q379 335 378 343Q372 371 358 385T334 402T308 404Q263 404 229 370Q202 343 195 315T187 232V168V108Q187 78 188 68T191 55T200 49Q221 46 249 46H265V0H257L234 1Q210 2 183 2T145 3Q42 3 33 0H25V46H41Z"></path><path stroke-width="1" id="MJMAIN-61" d="M137 305T115 305T78 320T63 359Q63 394 97 421T218 448Q291 448 336 416T396 340Q401 326 401 309T402 194V124Q402 76 407 58T428 40Q443 40 448 56T453 109V145H493V106Q492 66 490 59Q481 29 455 12T400 -6T353 12T329 54V58L327 55Q325 52 322 49T314 40T302 29T287 17T269 6T247 -2T221 -8T190 -11Q130 -11 82 20T34 107Q34 128 41 147T68 188T116 225T194 253T304 268H318V290Q318 324 312 340Q290 411 215 411Q197 411 181 410T156 406T148 403Q170 388 170 359Q170 334 154 320ZM126 106Q126 75 150 51T209 26Q247 26 276 49T315 109Q317 116 318 175Q318 233 317 233Q309 233 296 232T251 223T193 203T147 166T126 106Z"></path><path stroke-width="1" id="MJMAIN-78" d="M201 0Q189 3 102 3Q26 3 17 0H11V46H25Q48 47 67 52T96 61T121 78T139 96T160 122T180 150L226 210L168 288Q159 301 149 315T133 336T122 351T113 363T107 370T100 376T94 379T88 381T80 383Q74 383 44 385H16V431H23Q59 429 126 429Q219 429 229 431H237V385Q201 381 201 369Q201 367 211 353T239 315T268 274L272 270L297 304Q329 345 329 358Q329 364 327 369T322 376T317 380T310 384L307 385H302V431H309Q324 428 408 428Q487 428 493 431H499V385H492Q443 385 411 368Q394 360 377 341T312 257L296 236L358 151Q424 61 429 57T446 50Q464 46 499 46H516V0H510H502Q494 1 482 1T457 2T432 2T414 3Q403 3 377 3T327 1L304 0H295V46H298Q309 46 320 51T331 63Q331 65 291 120L250 175Q249 174 219 133T185 88Q181 83 181 74Q181 63 188 55T206 46Q208 46 208 23V0H201Z"></path><path stroke-width="1" id="MJMAIN-2264" d="M674 636Q682 636 688 630T694 615T687 601Q686 600 417 472L151 346L399 228Q687 92 691 87Q694 81 694 76Q694 58 676 56H670L382 192Q92 329 90 331Q83 336 83 348Q84 359 96 365Q104 369 382 500T665 634Q669 636 674 636ZM84 -118Q84 -108 99 -98H678Q694 -104 694 -118Q694 -130 679 -138H98Q84 -131 84 -118Z"></path><path stroke-width="1" id="MJMATHI-71" d="M33 157Q33 258 109 349T280 441Q340 441 372 389Q373 390 377 395T388 406T404 418Q438 442 450 442Q454 442 457 439T460 434Q460 425 391 149Q320 -135 320 -139Q320 -147 365 -148H390Q396 -156 396 -157T393 -175Q389 -188 383 -194H370Q339 -192 262 -192Q234 -192 211 -192T174 -192T157 -193Q143 -193 143 -185Q143 -182 145 -170Q149 -154 152 -151T172 -148Q220 -148 230 -141Q238 -136 258 -53T279 32Q279 33 272 29Q224 -10 172 -10Q117 -10 75 30T33 157ZM352 326Q329 405 277 405Q242 405 210 374T160 293Q131 214 119 129Q119 126 119 118T118 106Q118 61 136 44T179 26Q233 26 290 98L298 109L352 326Z"></path><path stroke-width="1" id="MJAMS-2234" d="M273 411Q273 437 291 454T334 471Q358 471 375 454T393 411T376 368T333 351Q307 351 290 368T273 411ZM84 38Q110 38 126 21T143 -22Q143 -46 127 -64T83 -82Q57 -82 41 -65T24 -22Q24 4 41 21T84 38ZM524 -22Q524 4 541 21T584 38Q608 38 625 21T643 -22Q643 -45 627 -63T583 -82Q557 -82 541 -65T524 -22Z"></path><path stroke-width="1" id="MJMATHI-64" d="M366 683Q367 683 438 688T511 694Q523 694 523 686Q523 679 450 384T375 83T374 68Q374 26 402 26Q411 27 422 35Q443 55 463 131Q469 151 473 152Q475 153 483 153H487H491Q506 153 506 145Q506 140 503 129Q490 79 473 48T445 8T417 -8Q409 -10 393 -10Q359 -10 336 5T306 36L300 51Q299 52 296 50Q294 48 292 46Q233 -10 172 -10Q117 -10 75 30T33 157Q33 205 53 255T101 341Q148 398 195 420T280 442Q336 442 364 400Q369 394 369 396Q370 400 396 505T424 616Q424 629 417 632T378 637H357Q351 643 351 645T353 664Q358 683 366 683ZM352 326Q329 405 277 405Q242 405 210 374T160 293Q131 214 119 129Q119 126 119 118T118 106Q118 61 136 44T179 26Q233 26 290 98L298 109L352 326Z"></path><path stroke-width="1" id="MJMAIN-22EF" d="M78 250Q78 274 95 292T138 310Q162 310 180 294T199 251Q199 226 182 208T139 190T96 207T78 250ZM525 250Q525 274 542 292T585 310Q609 310 627 294T646 251Q646 226 629 208T586 190T543 207T525 250ZM972 250Q972 274 989 292T1032 310Q1056 310 1074 294T1093 251Q1093 226 1076 208T1033 190T990 207T972 250Z"></path><path stroke-width="1" id="MJMATHI-7A" d="M347 338Q337 338 294 349T231 360Q211 360 197 356T174 346T162 335T155 324L153 320Q150 317 138 317Q117 317 117 325Q117 330 120 339Q133 378 163 406T229 440Q241 442 246 442Q271 442 291 425T329 392T367 375Q389 375 411 408T434 441Q435 442 449 442H462Q468 436 468 434Q468 430 463 420T449 399T432 377T418 358L411 349Q368 298 275 214T160 106L148 94L163 93Q185 93 227 82T290 71Q328 71 360 90T402 140Q406 149 409 151T424 153Q443 153 443 143Q443 138 442 134Q425 72 376 31T278 -11Q252 -11 232 6T193 40T155 57Q111 57 76 -3Q70 -11 59 -11H54H41Q35 -5 35 -2Q35 13 93 84Q132 129 225 214T340 322Q352 338 347 338Z"></path><path stroke-width="1" id="MJMATHI-65" d="M39 168Q39 225 58 272T107 350T174 402T244 433T307 442H310Q355 442 388 420T421 355Q421 265 310 237Q261 224 176 223Q139 223 138 221Q138 219 132 186T125 128Q125 81 146 54T209 26T302 45T394 111Q403 121 406 121Q410 121 419 112T429 98T420 82T390 55T344 24T281 -1T205 -11Q126 -11 83 42T39 168ZM373 353Q367 405 305 405Q272 405 244 391T199 357T170 316T154 280T149 261Q149 260 169 260Q282 260 327 284T373 353Z"></path><path stroke-width="1" id="MJMAIN-D7" d="M630 29Q630 9 609 9Q604 9 587 25T493 118L389 222L284 117Q178 13 175 11Q171 9 168 9Q160 9 154 15T147 29Q147 36 161 51T255 146L359 250L255 354Q174 435 161 449T147 471Q147 480 153 485T168 490Q173 490 175 489Q178 487 284 383L389 278L493 382Q570 459 587 475T609 491Q630 491 630 471Q630 464 620 453T522 355L418 250L522 145Q606 61 618 48T630 29Z"></path><path stroke-width="1" id="MJMAIN-221E" d="M55 217Q55 305 111 373T254 442Q342 442 419 381Q457 350 493 303L507 284L514 294Q618 442 747 442Q833 442 888 374T944 214Q944 128 889 59T743 -11Q657 -11 580 50Q542 81 506 128L492 147L485 137Q381 -11 252 -11Q166 -11 111 57T55 217ZM907 217Q907 285 869 341T761 397Q740 397 720 392T682 378T648 359T619 335T594 310T574 285T559 263T548 246L543 238L574 198Q605 158 622 138T664 94T714 61T765 51Q827 51 867 100T907 217ZM92 214Q92 145 131 89T239 33Q357 33 456 193L425 233Q364 312 334 337Q285 380 233 380Q171 380 132 331T92 214Z"></path>'}
  849. #
  850. # wordid = "5fc0d256407550d0b7d9a43c"
  851. #
  852. # res=Ruku(items_list, ocr_html, svg_data, wordid).upload_img()
  853. # pprint(res)
  854. f1 = open(r"F:\zwj\Text_Structure\new_tiku_structure_v3_sci\struct_items.pickle",'rb').read()
  855. items_list = pickle.loads(f1)
  856. # pprint(items_list)
  857. f2 = open(r"F:\zwj\Text_Structure\new_tiku_structure_v3_sci\svg_data.pickle", 'rb').read()
  858. svg_data = pickle.loads(f2)
  859. # svg_data = {"svg_path": "", "svg_html_data": ""}
  860. htmlt = open(r"F:\zwj\Text_Structure\accept_files\624802d612cd45a7836f342e.html", "r", encoding="utf8").read()
  861. res = Ruku(items_list, htmlt, svg_data, "20220408", {"callback_url": "1223", "source": ""}, "高中物理").upload_img()