123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835 |
- # -*- coding:utf-8 -*-
- import random, hashlib
- import requests
- import configs
- import shutil
- from utils.diffi_label import get_item_diff
- from utils.img2latex import get_ocrlatex_by_url
- from utils.qcloud_bucket import upload_img_to_qcloud, img_inbucket_count, client, filestream_upload
- from concurrent.futures import ProcessPoolExecutor
- from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
- from utils.image_convert import svg2png
- from utils.label_data_Hphy import Label
- from bisect import bisect_left
- import re, time, os, json, datetime
- from copy import deepcopy
- import traceback
- logger = configs.myLog(__name__, log_cate="ruku_log").getlog()
- subject_id = {
- "高中数学": 3,
- "高中英语": 8,
- "高中物理": 12,
- "高中化学": 13,
- "高中生物": 14,
- "高中政治": 15,
- "高中历史": 16,
- "高中地理": 17,
- "初中数学": 41,
- "初中英语": 42,
- "初中物理": 43,
- "初中化学": 44,
- "初中生物": 45,
- "初中地理": 46,
- "初中政治": 47,
- "初中历史": 48,
- "高中语文": 9,
- "初中语文": 40,
- }
- class Ruku():
- def __init__(self, items_list, htmlt, svg_data, wordid, callback_info, subject=""):
- self.items_list = items_list
- self.htmlt = htmlt
- self.svg_data = svg_data
- self.wordid = wordid
- self.callback_url = callback_info["callback_url"]
- self.source = callback_info["source"]
- self.subject = subject # items_list[0]["period"] + items_list[0]["subject"]
- self.callback_code = 0
- self.callback_err = ""
- self.ltx2url = {} # latex 映射 线上可访问url
- def bucket_img_del(self):
- """
- wordbin中图片上传腾讯云的原因:1.存在线上服务器的图片要定期删除,而有的题可能还没审核完;2.上传腾讯云比较便宜
- 删除腾讯云中的图片
- 根据【解析结果】文本中删除的图片信息,通过阙值判断是否从腾讯云中删除图片
- 也有限制:解析结果不能为空,结果中出现的图片在原试卷应该也要有!
- 有风险:对于已经校对过的试卷,如果后期有人在资源库里删除了大量文本,很可能导致正在使用的图片被删除
- 暂时第三方上传的试卷还是先不要删除比较稳妥!或新建图片用md5命名
- :return:
- """
- items_str = str(self.items_list)
- raw_imgs = []
- # img_source = "" http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/imgpaper/lqy_upload/612f60307ddb8b2765e50512/img_23.png
- img_source = ""
- items_str = re.sub(r'(<img src=)\'(.*?/(imgpaper/lqy_upload|zyk/uploadfiles/wording)/[^\']*?)\'', r'\1"\2"', items_str)
- if "imgpaper/lqy_upload" in items_str:
- raw_imgs = re.findall(r'<img src=".*?/(imgpaper/lqy_upload/[^"\']*?)"', items_str) # pdf/图片
- img_source = "p"
- elif "zyk/uploadfiles/wording/" in items_str:
- img_source = "w" # word
- # elif "stem_img" not in self.items_list[0]: # 批量解析时没有stem_img字段,但最后前端页面都会补上
- # img_source = "w"
- # elif any([True if "stem_img" in i and i["stem_img"] else False for i in self.items_list]):
- # img_source = "p"
- # else:
- # img_source = "w"
- # pdf/图片解析时,再解析新生成的图片也是用的zyk/uploadfiles/wording/
- logger.info("----【paper_id:{}】本套试卷类型:{}".format(self.wordid, img_source))
- # mj_pic = re.findall(r'<img src=".*?/(zyk/[^"\']+?/MJMATH-\d)', items_str)
- if img_source:
- time1 = time.time()
- raw_imgs.extend(re.findall(r'<img src=".*?/(zyk/uploadfiles/wording/[^"\']*?)"', items_str))
- bucket_imgs = img_inbucket_count(self.wordid, flag=img_source) # 如果img_source判断错误,则不进行后续操作
- logger.info("----【paper_id:{}】从桶里取数据时间:{}".format(self.wordid, time.time() - time1))
- time2 = time.time()
- if bucket_imgs:
- # 再解析过程中若删除了原已上传到腾讯云上的图片信息,需要判断下是否删除桶中的图片
- # 也有可能出现保存一遍后再保存
- # bucket_imgs = [i['Key'] for i in bucket_imgs] # dict:[{'Key': put_key}, {}]
- # print("bucket_imgs:", bucket_imgs)
- # print("raw_imgs:", raw_imgs)
- if len(bucket_imgs) - len(raw_imgs) > 5: # 多余图片超过5张才开始删除,包含mathjax生成的图片
- bucket_imgs = [i['Key'] for i in bucket_imgs] # dict:[{'Key': put_key}, {}]
- to_del_imgs = [bimg for bimg in bucket_imgs if bimg not in raw_imgs]
- if to_del_imgs:
- objects = {
- "Quiet": "true",
- "Object": [{'Key': item} for item in to_del_imgs]
- }
- client.delete_objects(configs.public_bucket, objects) # 批量删除
- logger.info("----【paper_id:{}】删除桶数据时间:{}".format(self.wordid, time.time() - time2))
- def mathjx2png(self):
- """
- 【基于mathjax渲染输出是svg格式】
- 将mathjax渲染的公式转化为图片格式
- mathjax渲染的svg图片提取->保存->格式转化
- :return:
- """
- file_path = configs.IMG_FOLDER + "/" + str(self.wordid)
- svgp_ltx = {} # svg图片本地路径 映射 latex
- put_key_mjmath = [] # 桶中key
- local_mjmath = [] # 本地图片存储位置
- ltx2svgcss = {} # latex 映射 svg-css
- if self.callback_url and "MathJax" in str(self.svg_data["svg_html_data"]): # 再解析中存在mathjax公式渲染的标签
- # 需要统计mathjax转png失败时的具体定位
- # 题号所在位置
- topicinfo = [[nm.end(), nm.group(1)] for nm in re.finditer('class="topic-number">(\d+)\.', str(self.svg_data["svg_html_data"]))]
- topicidx = [i[0] for i in topicinfo]
- topicno = [i[1] for i in topicinfo]
- time3 = time.time()
- all_mathjax = [[a.start(), a.group(1)] for a in
- re.finditer('(<span class="MathJax_Preview".*?</script>(</span>)*)',
- str(self.svg_data["svg_html_data"]))]
- # all_mathjax = re.findall('(<span class="MathJax_Preview".*?</script>(</span>)*)',
- # str(self.svg_data["svg_html_data"]))
- all_linkdata = re.findall('(<path stroke-width=".*?" id="(.*?)" d=".*?"></path>)', self.svg_data["svg_path"])
- link_dict = {a[1]: a[0] for a in all_linkdata if a}
- for n, jax in enumerate(all_mathjax):
- svgs = re.findall("<svg .*?</svg>", jax[1])
- latex = re.findall('<script .+?">(((?!(</)).)*?)</script>(</span>)*', jax[1])
- if latex and svgs:
- if latex and not latex[0][0].replace("{", "").replace("}", "").strip():
- id_idx = bisect_left(topicidx, jax[0]) # 二分法查找
- logger.info("----【paper_id:{}】第{}题存在mathjax公式为空:latex:{}\nsvg:{}".format(
- self.wordid, topicno[id_idx - 1], latex, svgs))
- else:
- ltx2svgcss["{}".format(latex[0][0])] = svgs[0] # latex去重
- else:
- id_idx = bisect_left(topicidx, jax[0])
- logger.info("----【paper_id:{}】第{}题存在mathjax公式格式有问题:latex:{}\nsvg:{}".format(
- self.wordid, topicno[id_idx - 1], latex, svgs))
- if latex:
- return "第{}题的公式latex:{}不规范,请编辑正确!".format(topicno[id_idx - 1], latex[0][0])
- else:
- return "第{}题的存在不规范的公式,,请重新编辑!".format(topicno[id_idx - 1])
- if ltx2svgcss:
- if not os.path.exists(file_path):
- os.makedirs(file_path)
- svg_mjmath_path = os.path.join(file_path, "svg_mjmath")
- # mjmath公式图片文件夹创建
- if not os.path.exists(svg_mjmath_path):
- os.makedirs(svg_mjmath_path)
- else: # 需要清空
- shutil.rmtree(svg_mjmath_path)
- os.makedirs(svg_mjmath_path)
- # ========== mathjax2svg===============
- # 方法一:时间戳+随机数->图片名
- # n = 0
- # name_list = random.sample(range(100000, 999999), len(ltx2svgcss)) # 随机数
- # for ltx, svg in ltx2svgcss.items():
- # linkkeys = list(set(re.findall(' xlink:href="#(.*?)"', svg)))
- # linkvalues = [link_dict[ld] for ld in linkkeys]
- # svg_p = file_path + "/svg_mjmath/MJMATH-{}.svg".format(str(int(time.time())) + str(name_list[n]))
- # fs = open(svg_p, 'w', encoding='utf8')
- # svg_1, svg_2 = svg.split("<g ", maxsplit=1)
- # fs.write(svg_1)
- # fs.write('<defs id="MathJax_SVG_glyphs">\n' + "\n".join(linkvalues) + "\n</defs>")
- # fs.write("<g " + svg_2)
- # fs.close()
- # svgp_ltx[svg_p] = ltx
- # n += 1
- # 方法二:图片命名MD5
- for ltx, svg in ltx2svgcss.items():
- linkkeys = list(set(re.findall(' xlink:href="#(.*?)"', svg)))
- linkvalues = [link_dict[ld] for ld in linkkeys]
- svg_1, svg_2 = svg.split("<g ", maxsplit=1)
- svg_con = svg_1 + '\n<defs id="MathJax_SVG_glyphs">\n' + "\n".join(linkvalues) + "\n</defs>\n"\
- + "<g " + svg_2
- pmd5 = hashlib.md5(svg_con.encode("utf8"))
- img_md5 = pmd5.hexdigest()
- svg_p = file_path + "/svg_mjmath/MJMATH-{}.svg".format(img_md5)
- fs = open(svg_p, 'w', encoding='utf8')
- fs.write(svg_con)
- fs.close()
- svgp_ltx[svg_p] = ltx
- logger.info(json.dumps({"log_level": "info",
- "paper_id": self.wordid,
- "mathjax2svg_time": time.time() - time3,
- "svgp_ltx": svgp_ltx}, ensure_ascii=False))
- time4 = time.time()
- # 2.2>>svg转png
- if svgp_ltx:
- try:
- with ThreadPoolExecutor(max_workers=6) as t:
- all_png_info = [t.submit(svg2png, arg) for arg in svgp_ltx.keys()]
- except Exception as e:
- logger.info(json.dumps({"log_level": "warn",
- "paper_id": self.wordid,
- "status": "svg2png失败",
- "errmsg": str(e)}, ensure_ascii=False))
- all_png_info = []
- all_png_info = [i.result() for i in all_png_info]
- for shape, img_path in all_png_info:
- local_mjmath.append(img_path)
- imgname_online = "/zyk/uploadfiles/wording/" + str(self.wordid) + "/{}".format(os.path.basename(img_path))
- put_key_mjmath.append(imgname_online)
- mj_ltx = svgp_ltx[img_path.replace(".png", ".svg")].replace("\\\\", "\\")
- mjmath_online = '<img src="http://' + configs.public_bucket_addr + imgname_online \
- + '" width="{}" height="{}" data-type="math" data-latex="{}" />'.format(
- shape[0] / 2, shape[1] / 2, "${}$".format(mj_ltx))
- self.ltx2url[mj_ltx] = mjmath_online
- logger.info(json.dumps({"log_level": "info",
- "paper_id": self.wordid,
- "svg2png_time": time.time() - time4,
- "ltx2url": self.ltx2url}, ensure_ascii=False))
- return put_key_mjmath, local_mjmath
- def upload_img(self):
- """
- items_list:结构化纯文本
- htmlt:ocr或word解析后的html文本
- svg_data:{"svg_html_data": "", "svg_path": ""} 含svg数据的结构化整体html文本,svg中的索引数据
- wordid:试卷存储id
- callback_url: 回调地址
- 入库操作包含:
- 1、再解析后确认入库时,将image上传,htmlt中图片;
- 2、学管端可以是组合(文本+图片)的解析结果。学管可以选择和修改文本,但选择的文本解析时都会替换原先的img标签内容,
- 最后入库时,传回学管端的都是带img标签的结果
- 3、传回学管端和共享题库的题目中的$$公式要转换为图片;
- $$左右还有公式字符串的话,在结构化过程中一起并入!!!
- 4、调取查重关联功能,暂时不调自动标注;
- 5、传入校本题库(发送标注),将结构化后的每道题设置个与大数据资源库的关联标签,如"zyk_id":id+题号
- 5种图片:1>>ser_static/.*?/word/media(解析服务中最开始保存在线上服务器本地)
- 2>>/zyk/uploadfiles/wording/(解析服务中上传到腾讯云)
- 3、4>>ser_static/.*?/(new_image[^"]*?|eq_img_\d.png):批量再解析和单题再解析中,
- 用户在编辑页面新粘贴进来的base64图片,以及批量再解析中域公式转图片,临时存在结构化服务器本地
- 5、利用mathjax渲染latex的svg格式转为png,再上传到腾讯云
- 上传之前,将腾讯云桶里的new_image全部替换,raw_image判断下再替换
- items_list:list 所有题目
- :return:
- res_zyk = {"data":{"html": xxx, "items": xxx}, "errcode": 0, "errmsgs": ""}
- res_xbk = {"items": xxx, "errcode": 0, "errmsg":"ok"}
- """
- res_xbk = {"items": [], "errcode": 0, "errmsg": "ok", "callback_type": 2, "subject_id": self.subject}
- res_zyk = {"errcode": 0, "errmsgs": "", "data": {"html": self.htmlt, "items": self.items_list}}
- # 1>>判断删除腾讯云桶内图片
- if self.source not in ["teacher", "xue_guan"]: # {"xue_guan": "1", "teacher": "2", "ai": "3"}
- self.bucket_img_del()
- # ---------------------------------------------------------------------
- # 1.2>>将zyk/uploadfiles/wording/ 路径的缺latex的公式图片,再调mathpix接口拿到latex填充
- # 2>>mathjax渲染的svg图片提取->保存->格式转化
- svg_convert_res = self.mathjx2png()
- if type(svg_convert_res) == str:
- res_xbk = {"items": [], "errcode": 1, "errmsg": svg_convert_res, "callback_type": 2, "subject_id": self.subject}
- res_zyk = {"errcode": 1, "errmsgs": svg_convert_res, "data": {}}
- if self.callback_url:
- self.callback_user(res_xbk, self.callback_url)
- if self.source == "xue_guan":
- self.callback_php(res_xbk) # 失败时就不发送数据库端了,但学管端时发送
- return res_zyk
- put_key_mjmath, local_mjmath = svg_convert_res
- # --------------------------------------------------------------------
- # 3>> 统计 ocr和结构化试题 中的新图片,以防结构化入库的试题少了而导致图片上传不足,左边页面无法显示
- put_key_list = [] # 桶中key
- localnewpic_list = [] # 本地图片存储位置
- imgs_url_list = [] # 远程服务器上图片存储位置
- put_key_imgsurl = []
- new_imgs = re.findall(r'<img src=".*?/ser_static/.*?/(new_image[^"]*?|eq_img_\d+\.png)"', str(self.htmlt))
- new_imgs2 = re.findall(r'<img src=".*?/ser_static/.*?/(new_image[^"]*?|eq_img_\d+\.png)"', str(self.items_list))
- new_imgs.extend(new_imgs2)
- # print(new_imgs)
- new_imgs = list(set(new_imgs))
- if new_imgs:
- put_key_list.extend(["/zyk/uploadfiles/wording/" + str(self.wordid) + "/{}".format(img_name)
- for img_name in new_imgs])
- file_path = configs.IMG_FOLDER + "/" + str(self.wordid)
- localnewpic_list.extend([file_path + "/field_eq/" + img_name if "eq_img_" in img_name
- else file_path + "/" + img_name for img_name in new_imgs])
- old_imgs = re.findall(r'<img src="(.*?/ser_static[/\\](.*?/word/media)/(image[^"]*?))"', str(self.htmlt))
- if old_imgs: # 针对最开始入库的情况,后期都直接在wordbin时就上传腾讯云了
- # 以前新添加的图片在左预览页仍以base64保存,若再解析,则会按新的方法保存到本地
- # 只是最开始解析的老图片是保存在服务器本地的,若入库时,则一起拿出来再上传腾讯云
- if configs.external_ip not in old_imgs[0][0]: # 非本地图片
- imgs_url_list.extend([img_name[0] for img_name in old_imgs])
- put_key_imgsurl.extend(["/zyk/uploadfiles/wording/" + str(self.wordid) + "/{}".format(img[2])
- for img in old_imgs])
- else: # 本地图片
- file_path = configs.RawImg_UploadFolder + "/" + old_imgs[0][1]
- put_key_list.extend(["/zyk/uploadfiles/wording/" + str(self.wordid) + "/{}".format(img[2])
- for img in old_imgs])
- localnewpic_list.extend([file_path + "/" + img[2] for img in old_imgs])
- if self.callback_url:
- put_key_list.extend(put_key_mjmath)
- localnewpic_list.extend(local_mjmath)
- # ------------------------------------------------------------------------------------------
- items_res_to_xbk = []
- repeat_time = 0
- if localnewpic_list or imgs_url_list: # 本地有新图片时
- new_img_online = '<img src="http://' + configs.public_bucket_addr + "/zyk/uploadfiles/wording/" + str(self.wordid)
- new_img_local = '<img src="' + configs.new_img_ip + '/' + str(self.wordid) # 结构化中产生的图片
- old_img_local = "" # wordbin最初产生的图片
- if old_imgs:
- # new_img_local = '<img src="' + configs.old_img_ip + '/' + old_imgs[0][0]
- old_img_local = '<img src="' + old_imgs[0][0].split("ser_static")[0]+"ser_static" + '/' + old_imgs[0][1]
- def sub1(s):
- """图片访问地址替换,本地替换为线上"""
- if s:
- s = re.sub(r'(<img src="[^"]*?[a-z\d])\\(?!\\)([^"]*?")', r"\1/\2", str(s)) # 将路径中的\改为/
- s = s.replace(new_img_local, new_img_online)
- if old_img_local:
- return s.replace(old_img_local, new_img_online)
- return s
- def sub2(s):
- """将试题中的latex转为线上可访问图片地址"""
- if s:
- all_ltx = re.findall(r'\$.*?\$', s) # 查找试题结构中的公式
- all_ltx.extend(re.findall('\\\\\(.*?\\\\\)', s))
- all_ltx = list(set(all_ltx))
- for ltx in all_ltx:
- new_ltx = ltx.replace("$", "").replace("\\(", "").replace("\\)", "")\
- .replace("&", "&").replace("<", "<").replace("\\u200a", " ")
- if new_ltx in self.ltx2url: # 将latex换为其渲染图片的线上可访问地址
- s = s.replace(ltx, self.ltx2url[new_ltx])
- s = re.sub(r' data-latex="<img .*?data-latex=(".*?").*?/>"\s*/>', r" data-latex=\1 />", s)
- return s
- def ltx2url_repl(one_items):
- """
- 将每道题结构中的各字段进行匹配替换 ltx2url
- """
- keys_items = ["stem", "key", "parse", "options", "slave"]
- if self.ltx2url:
- for k in keys_items:
- if k in one_items:
- if k == "options":
- one_items[k] = list(map(sub2, one_items[k]))
- elif k == "slave":
- for slave_one in one_items[k]:
- ltx2url_repl(slave_one)
- else:
- one_items[k] = sub2(one_items[k])
- # else:
- # logger.info("----【word_id:{}】第{}道题{}字段有问题".format(self.wordid, one_items["topic_num"], k))
- time6 = time.time()
- # 4>> 结构化题目中图片地址替换,需要区分下学管端还是云题库!!!!!一定会保存一份在资源库
- items_res_to_zyk = self.items_list.copy()
- items_res_to_zyk = eval(sub1(items_res_to_zyk))
- # for one_items in items_res_to_zyk:
- # for k in ["stem", "key", "parse", "options"]: # "analysis",
- # if k in one_items:
- # if k == "options":
- # one_items[k] = list(map(sub1, one_items[k]))
- # else:
- # one_items[k] = sub1(one_items[k])
- # -----------难度和知识点自动标注------------------------
- # diffs_xbk, items_res_to_zyk = self.get_diff(items_res_to_zyk.copy()) # 难度
- for nn, one_items in enumerate(deepcopy(items_res_to_zyk)):
- new_one_item = {}
- # if "slave" not in one_items and re.findall("_{2,}", one_items["stem"]):
- # new_one_item["blank_num"] = len(re.findall("_{2,}", one_items["stem"]))
- if self.callback_url:
- # 查重
- if self.source != "xue_guan":
- repeat_r, repeat_time = self.repeat_check(nn, one_items, repeat_time)
- if type(repeat_r) == str:
- res_xbk = {"items": [], "errcode": 1, "errmsg": repeat_r, "callback_type": 2, "subject_id": self.subject}
- res_zyk = {"errcode": 1, "errmsgs": repeat_r, "data": {}}
- self.callback_user(res_xbk, self.callback_url)
- return res_zyk
- new_one_item["repeat_res"] = repeat_r
- new_one_item["topic_type_id"] = one_items["checkType"]["id"]
- if "options_rank" in one_items and one_items["options_rank"]:
- new_one_item["options_rank"] = one_items["options_rank"]
- ltx2url_repl(one_items)
- self.comans2parse(one_items)
- new_one_item.update(one_items)
- items_res_to_xbk.append(new_one_item)
- # 5>> ocr-htmlt中图片地址替换成云上地址
- self.htmlt = re.sub(r'(<img src="[^"]*?[a-z\d])\\(?!\\)([^"]*?")', r"\1/\2", self.htmlt)
- self.htmlt = self.htmlt.replace(new_img_local, new_img_online)
- if old_img_local:
- self.htmlt = self.htmlt.replace(old_img_local, new_img_online)
- logger.info(json.dumps({"log_level": "info",
- "paper_id": self.wordid,
- "imgurl_repl_time": time.time() - time6,
- "repeat_time": repeat_time}, ensure_ascii=False))
- # -----------------------------------------------------------------------
- # 6 >> new_image上传腾讯云
- try:
- logger.info('----【paper_id:{}】再解析开始上传图片到cloud,并替换成线上地址----'.format(self.wordid))
- stime_u = time.time()
- # TODO 一个进程解析,一个进程上传
- executor1 = ThreadPoolExecutor(5)
- executor1.map(upload_img_to_qcloud, zip(put_key_list, localnewpic_list))
- if imgs_url_list:
- executor1.map(filestream_upload, zip(put_key_imgsurl, imgs_url_list))
- executor1.shutdown(wait=True) # 进程池内部的进程都执行完毕,才会关闭,然后执行后续代码
- img_upload_time = time.time() - stime_u
- logger.info(json.dumps({"log_level": "info",
- "paper_id": self.wordid,
- "img_upload_time": img_upload_time}, ensure_ascii=False))
- res_zyk = {"data": {"html": self.htmlt, "items": items_res_to_zyk}, "errcode": 0, "errmsgs": ""}
- res_xbk = {"items": items_res_to_xbk, "errcode": 0, "errmsg": "ok", "callback_type": 2, "subject_id": self.subject}
- except Exception as e:
- res_xbk = {"items": [], "errcode": 1, "errmsg": "公式或图片上传腾讯云失败", "callback_type": 2, "subject_id": self.subject}
- res_zyk = {"data":{"html": self.htmlt, "items": self.items_list}, "errcode": 1,
- "errmsgs": "公式或图片上传腾讯云失败"}
- logger.info(json.dumps({"log_level": "warn",
- "paper_id": self.wordid,
- "status": "公式或图片上传腾讯云失败",
- "errmsg": str(e)}, ensure_ascii=False))
- else: # 本地没有新图片时
- # -----------难度、知识点自动标注------------------------
- # diffs_xbk, self.items_list = self.get_diff(self.items_list) # 难度
- if self.callback_url:
- for nn, one_items in enumerate(self.items_list):
- new_one_item = {}
- # 查重
- if self.source != "xue_guan":
- repeat_r, repeat_time = self.repeat_check(nn, one_items, repeat_time)
- if type(repeat_r) == str:
- res_xbk = {"items": [], "errcode": 1, "errmsg": repeat_r, "callback_type": 2, "subject_id": self.subject}
- res_zyk = {"errcode": 1, "errmsgs": repeat_r, "data": {}}
- self.callback_user(res_xbk, self.callback_url)
- return res_zyk
- new_one_item["repeat_res"] = repeat_r
- new_one_item["topic_type_id"] = one_items["checkType"]["id"]
- if "options_rank" in one_items and one_items["options_rank"]:
- new_one_item["options_rank"] = one_items["options_rank"]
- self.comans2parse(one_items)
- new_one_item.update(one_items)
- items_res_to_xbk.append(new_one_item)
- res_xbk = {"items": items_res_to_xbk, "errcode": 0, "errmsg": "ok", "callback_type": 2, "subject_id": self.subject}
- logger.info(json.dumps({"log_level": "info",
- "paper_id": self.wordid,
- "repeat_time": repeat_time}, ensure_ascii=False))
- # 先传一份到校本题库,再返回结果
- if self.callback_url:
- # 上传腾讯云失败,将结果保存本地一份
- self.callback_err = ""
- self.callback_code = 0
- self.save_post_file(res_xbk)
- have_err = self.callback_user(res_xbk, self.callback_url)
- if self.source == "xue_guan" or not have_err: # 失败时就不发送数据库端了,但学管端时发
- self.callback_php(res_xbk)
- return res_zyk
- def comans2parse(self, one_items):
- """
- 将小问答案没拆出来的部分放入公共解析字段中
- :return:
- """
- # 此阶段将每个题可能的报错信息去掉
- if "errmsgs" in one_items and one_items["errmsgs"]:
- one_items["errmsgs"] = ""
- # 将小问答案没拆出来的部分放入公共解析字段中
- if "slave" in one_items and one_items["slave"]:
- if one_items["key"] and all(
- [True if not s["key"].strip() else False for s in one_items["slave"]]): # 带小题的且小题答案都为空
- if one_items["parse"].strip():
- one_items["parse"] = "【答案】\n{}\n【解析】\n{}".format(one_items["key"], one_items["parse"])
- else:
- one_items["parse"] = "【答案】\n{}".format(one_items["key"])
- one_items["key"] = ""
- for one_slave in one_items["slave"]:
- if "slave" in one_slave and one_slave["slave"] and one_slave["key"] and \
- all([True if not s["key"].strip() else False for s in one_slave["slave"]]): # 带小题的且小题答案都为空
- if one_slave["parse"].strip():
- one_slave["parse"] = "【答案】\n{}\n【解析】\n{}".format(one_slave["key"],
- one_slave["parse"])
- else:
- one_slave["parse"] = "【答案】\n{}".format(one_slave["key"])
- one_slave["key"] = ""
- def save(self):
- """
- 入口函数
- :return:
- """
- res_xbk = {"items": [], "errcode": 1, "errmsg": "保存失败", "callback_type": 2, "subject_id": self.subject}
- try:
- res_zyk = self.upload_img()
- return res_zyk
- except Exception as e:
- print("------【paper_id:{}】最后的保存失败:{}-------".format(self.wordid, str(e)))
- print(traceback.print_exc())
- logger.info(json.dumps({"log_level": "warn",
- "paper_id": self.wordid,
- "status": "入库失败",
- "errmsg": str(e),
- "task_name": "保存入库"}, ensure_ascii=False))
- if self.callback_url:
- self.callback_code = 1
- self.callback_err = "保存失败"
- self.callback_user(res_xbk, self.callback_url, err="1")
- if self.source == "xue_guan":
- self.callback_php(res_xbk) # 失败时就不发送数据库端了,但学管端时发
- # else:
- # logger.info("------【paper_id:{}】保存失败-------".format(self.wordid))
- # self.callback_code = 1
- # self.callback_err = "保存失败"
- # self.callback_user(res_xbk, self.callback_url)
- # self.callback_php(res_xbk)
- return {"errcode": 1, "errmsgs": "入库失败!", "data": {}}
- def save_post_file(self, parse_res):
- """保存回调的数据解析结果"""
- now_time = datetime.datetime.now()
- time_str = datetime.datetime.strftime(now_time, '%Y_%m_%d_%H_%M_%S')
- # aft_modify = (str("word_name") + '__' + str(random.random())).encode("utf-8")
- # hh = hashlib.md5(aft_modify).hexdigest()
- aft_name = self.wordid + '__' + time_str + '.json'
- res_folder = configs.RES_FOLDER # 保存的文件夹
- new_fpath = os.path.join(res_folder, aft_name)
- re_f = open(new_fpath, 'w', encoding='utf-8')
- json.dump(parse_res, re_f,ensure_ascii=False)
- def get_phy_kps_auto(self, one_items, kps_label_time):
- """
- 调取物理自动标注的端口获取考点
- :return:
- """
- def phy_kps(input_data):
- label_auto = {}
- if input_data:
- r = requests.post(configs.kps_phy_ip, json=input_data) # json={"input_data": item}
- if r.status_code == 200:
- res = r.json()['result'] # eval(r.text)
- if res:
- label_auto.update(res)
- return label_auto
- t1 = time.time()
- temp_items = {"server_state": 11,
- "fine_state": 0,
- "add_parse_state": 1}
- one_info = {"topic_id": one_items["topic_num"],
- "content": one_items["stem"],
- "option": one_items["options"] if "options" in one_items else [],
- "parse": one_items["parse"],
- "kpl_codes": [], "ori_sences": [], "ori_kpl_codes": [],
- "topic_type_id": one_items["checkType"]["id"]}
- temp_items["info"] = one_info
- # 散题
- # temp_items["parse"] = str(one_items["key"]) + "<br/>" + one_items["parse"]
- # if "analysis" in one_items:
- # temp_items["parse"] += "<br/>" + one_items["analysis"]
- auto_kps = phy_kps(temp_items)
- print("自动标注考点:", auto_kps)
- kps_label_time += time.time() - t1
- return auto_kps, kps_label_time
- def img2latex(self):
- # 3>> 统计结构化试题data-latex为空的图片,再ocr-latex处理并替换
- time5 = time.time()
- items_str = str(self.items_list)
- all_imgs_no_latex = re.findall(r'(<img src="(.*?)".*? data-latex="\$?\s*\$?")', items_str)
- if all_imgs_no_latex:
- imgurl_no_latex = [k[1] for k in all_imgs_no_latex]
- imgurl_no_latex = list(set(imgurl_no_latex))
- mathpixs = []
- try:
- if len(imgurl_no_latex) <= 20:
- mathpixs.extend([get_ocrlatex_by_url(i) for i in imgurl_no_latex])
- else:
- if len(imgurl_no_latex) <= 50:
- executor = ThreadPoolExecutor(max_workers=2) # 开2个线程会稍微快点
- else:
- executor = ThreadPoolExecutor(max_workers=4)
- for data in executor.map(get_ocrlatex_by_url, imgurl_no_latex):
- mathpixs.append(data)
- logger.info("----【paper_id:{}】latex-ocr:{}".format(self.wordid, mathpixs))
- def sub3(ss):
- new_ss = ss.group(1) + ' data-type="math-ocr" data-latex="$' + mathpixs[mi] + '$"' + ss.group(2)
- return new_ss.replace(' data-type="math"', "")
- # return ss.group(1) + 'data-type="math-ocr" data-latex="$' + mathpixs[mi] + '$"'
- for mi, m in enumerate(imgurl_no_latex):
- # items_str = re.sub(r'(<img src="{}".*?) data-latex="\$?\s*\$?"'.format(m), sub3, items_str)
- if mathpixs[mi]:
- items_str = re.sub(r'(<img src="{}".*?) data-latex="\$?\s*\$?"(.*?(?<=")\s*/?>)'.format(m),
- sub3, items_str)
- self.items_list = eval(items_str)
- logger.info("----【paper_id:{}】结构化试题中空latex掉mathpix转化时间:{}".format(self.wordid, time.time() - time5))
- except:
- logger.info("----【paper_id:{}】latex-ocr转化过程失败".format(self.wordid))
- # -------------------------------------------------------------------
- def get_diff(self, items_res_to_zyk):
- # -----------难度和知识点自动标注------------------------
- t11 = time.time()
- diffs_xbk = [""] * len(items_res_to_zyk)
- if self.subject == 3: # "高中数学"
- from multiprocessing.dummy import Pool as ThreadPool
- pool = ThreadPool(2) # 比# pool = multiprocessing.Pool(3)速度快
- diff_info = list(pool.map(get_item_diff, items_res_to_zyk))
- items_res_to_zyk = [f[0] for f in diff_info]
- diffs_xbk = [f[1] for f in diff_info]
- logger.info("----【paper_id:{}】结构化试题中难度标注时间:{}".format(self.wordid, time.time() - t11))
- return diffs_xbk, items_res_to_zyk
- def repeat_check(self, id, one_items, repeat_time):
- t22 = time.time()
- # print(one_items)
- chachong_item_dict = {"topic_id": id + 1,
- "subject_id": self.subject,
- "topic_type_id": one_items["checkType"]["id"],
- "content": one_items["stem"]}
- if "options" in one_items:
- chachong_item_dict["options"] = one_items["options"]
- if "slave" in one_items:
- chachong_item_dict["slave"] = one_items["slave"]
- try:
- repeat_r = requests.post(url=configs.repeat_ip, json=[chachong_item_dict]).json()
- print("查重结果:", repeat_r) # [str(id + 1)]
- if repeat_r:
- repeat_r = repeat_r[str(id + 1)]
- else:
- repeat_r = []
- except Exception as e:
- logger.info("----【paper_id:{}】查重服务异常:{}".format(self.wordid, e))
- repeat_r = "保存入库查重服务异常"
- repeat_time += time.time() - t22
- return repeat_r, repeat_time
- def callback_user(self, res_xbk, callback_url, err=""):
- """全学科题库、第三方上传试卷回调"""
- have_err = 0
- if not err:
- if res_xbk["errcode"]:
- have_err = 1
- logger.info(json.dumps({"log_level": "info",
- "paper_id": self.wordid,
- "status": "入库失败",
- "errmsg": res_xbk["errmsg"],
- "task_name": "保存入库"}, ensure_ascii=False))
- else:
- logger.info(json.dumps({"log_level": "info",
- "paper_id": self.wordid,
- "status": "入库成功",
- "task_name": "保存入库"}, ensure_ascii=False))
- try:
- r = requests.post(callback_url,
- # json=res, # 可以,但是会进行转义
- headers={"Content-Type": "application/json"},
- data=json.dumps(res_xbk, ensure_ascii=False).encode("utf-8"), # 文件开头有编码显示
- )
- print("------【paper_id:{}】,post 回调地址状态:{}===>回调结果: {} -------\n".format(self.wordid, r.status_code, r.text))
- if r.status_code != 200:
- have_err = 1
- if r.text != "解析完成!":
- have_err = 1
- logger.info(json.dumps(
- {"log_level": "info",
- "paper_id": self.wordid,
- "callback_res": {"status": "回调成功" if r.status_code == 200 else "回调失败",
- "status_code": r.status_code,
- "text": r.text,
- "callback_url": callback_url},
- "task_name": "入库回调"}, ensure_ascii=False))
- except Exception as e:
- self.callback_err += "回调出错"
- self.callback_code = 1
- have_err = 1
- print("------【paper_id:{}】回调出错:{}-------".format(self.wordid, e))
- logger.info(json.dumps(
- {"log_level": "warn",
- "paper_id": self.wordid,
- "callback_res": {"status": "回调失败",
- "callback_url": callback_url},
- "errmsg": str(e),
- "task_name": "入库回调"}, ensure_ascii=False))
- else:
- if r.status_code != 200:
- have_err = 1
- self.callback_code = 1
- self.callback_err = "回调出错:{}".format(r.status_code)
- logger.info(json.dumps(
- {"log_level": "warn",
- "paper_id": self.wordid,
- "callback_res": {"status": "回调失败",
- "status_code": r.status_code,
- "text": r.text,
- "callback_url": callback_url},
- "task_name": "入库回调"}, ensure_ascii=False))
- return have_err
- def callback_php(self, res_xbk):
- """
- 将解析校对完的试题返回数据库端
- :param res_xbk: 返回给其它端的数据
- :return:
- """
- if res_xbk["errmsg"] not in ["ok", "保存失败"]: # 公式上传腾讯云失败等
- self.callback_err += res_xbk["errmsg"]
- if self.callback_err:
- self.callback_code = 1
- type_check = {"errcode": self.callback_code,
- "errmsg": self.callback_err,
- "parseId": self.wordid,
- "callback_type": 2,
- "data": [k["checkType"]["id"] for k in self.items_list],
- }
- try:
- r2 = requests.post(configs.callback_url_taskcheck,
- data=json.dumps(type_check, ensure_ascii=False).encode("utf-8"))
- print("------【paper_id:{}】taskcheck post数据:{} 回调地址状态:{}===>回调结果: {}-------".format(
- self.wordid, type_check, r2.status_code, r2.text))
- logger.info(json.dumps({"log_level": "info",
- "paper_id": self.wordid,
- "callback_data": type_check,
- "callback_res": {"status": "回调成功" if r2.status_code == 200 else "回调失败",
- "status_code": r2.status_code,
- "text": r2.text,
- "callback_url": configs.callback_url_taskcheck},
- "task_name": "入库回调"}, ensure_ascii=False))
- except Exception as e:
- print("------【paper_id:{}】taskcheck回调出错:{}-------".format(self.wordid, e))
- logger.info(json.dumps({"log_level": "warn",
- "paper_id": self.wordid,
- "callback_data": type_check,
- "callback_res": {"status": "回调失败",
- "callback_url": configs.callback_url_taskcheck},
- "errmsg": str(e),
- "task_name": "入库回调"}, ensure_ascii=False))
- else:
- if r2.status_code != 200:
- print("------【paper_id:{}】taskcheck回调出错:{}".format(self.wordid, r2.status_code))
- logger.info(json.dumps({"log_level": "warn",
- "paper_id": self.wordid,
- "callback_data": type_check,
- "callback_res": {"status": "回调失败",
- "status_code": r2.status_code,
- "text": r2.text,
- "callback_url": configs.callback_url_taskcheck},
- "task_name": "入库回调"}, ensure_ascii=False))
- if __name__ == '__main__':
- from pprint import pprint
- import pickle
- # items_list = [{'id': '60bdcd734a5335001b0a73cf', 'type': '填空题',
- # 'stem': '在数列\\({\\lbrace a_{n}\\rbrace }\\)中,若\\({a_{1}=1,a_{n}-a_{n-1}=n(n\\geq 2),}\\)则该数列的通项\\({a_{n}=}\\)',
- # 'options': [], 'key': '\\( \\frac{1}{2} \\) \n ',
- # 'subject': '数学', 'errmsgs': '', 'topic_num': 0, 'parse_img': '略', 'analysis': '', 'slave_img': '',
- # 'parse': '略 \n \n ', 'category': ['月考'], 'grade': '高一',
- # 'stem_img': "<img src='http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/imgpaper/lqy_upload/img_5fc0d256407550d0b7d9a43c_56.png' width='305' height='18' />", 'period': '高中',
- # 'province': '湖北', 'susp_pic': None, 'option_str': '', 'blank_num': None, 'year': 2020, 'difficulty': '中',
- # 'specials': [], 'upload_time': '2021-07-16T13:51:49.561000Z',
- # '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': [],
- # 'options_rank': None, 'text_status': None, 'img_status': 1,
- # 'source': {'type': 's',
- # 'related_exampaper': [{'paper_id': '5fc0d256407550d0b7d9a43c',
- # 'file_name': '十堰市一中 2019 级高一下4月月考 数学试题包含答案 ',
- # 'item_id': None}]}}]
- # 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/'
- # 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="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>" 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="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>&#x2212;</mo><msub><mi>a</mi><mrow class="MJX-TeXAtom-ORD"><mi>n</mi><mo>&#x2212;</mo><mn>1</mn></mrow></msub><mo>=</mo><mi>n</mi><mo stretchy="false">(</mo><mi>n</mi><mo>&#x2265;</mo><mn>2</mn><mo stretchy="false">)</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="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>" 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="http://www.w3.org/1998/Math/MathML"><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>'}
- #
- # wordid = "5fc0d256407550d0b7d9a43c"
- #
- # res=Ruku(items_list, ocr_html, svg_data, wordid).upload_img()
- # pprint(res)
- one_item = {'blank_num': None,
- 'category': ['月考'],
- 'checkType': {'id': 2, 'name': '多选题'},
- 'difficulty': '中',
- 'errmsgs': '',
- 'grade': '高二',
- 'id': '61a86291144d756b26cdd313',
- 'img_status': None,
- 'key': 'B、D',
- 'key_img': None,
- 'options': ['车厢与斜面间的动摩擦因数为<img '
- 'src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zyk/uploadfiles/wording/6195e6d034b3123bf9d1fbf7/MJMATH-1638425225691887.png" '
- 'width="18.5" height="25.0" '
- 'data-latex="${\\frac{\\sqrt {3}}{2}}$" '
- '/><br/><img '
- 'src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zyk/uploadfiles/wording/6195e6d034b3123bf9d1fbf7/MJMATH-1638425225854559.png" '
- 'width="31.0" height="17.5" '
- 'data-latex="${\\angle _{2}//}$" />',
- '车厢与斜面间的动摩擦因数为Y',
- '轻绳OA的拉力大小为2mg',
- '轻绳OA拉力大小为mg'],
- 'options_img': [],
- 'options_rank': 1,
- 'parse': '',
- 'parse_img': None,
- 'period': '高中',
- 'province': '山东',
- 'source': {'related_exampaper': [{'file_name': '山东选调物理',
- 'item_id': None,
- 'paper_id': '6195e6d034b3123bf9d1fbf7'}],
- 'type': 's'},
- 'specials': [],
- 'stem': '如图所示,一车厢沿固定足够长斜面向上运动,斜面倾角θ=30°,车厢内有一质量为m的小<br/>球通过轻绳系于车厢顶部,稳定时,轻绳OA与垂直斜面方向的夹角也为θ,重力加速度为g,<br/>下列说法正确的是<br/><img '
- "src='http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/imgpaper/lqy_upload/6195e6d034b3123bf9d1fbf7/img_50.png' "
- "width='148' height='111' />",
- 'stem_img': None,
- 'subject': '物理',
- 'topic_num': 9,
- 'type': '多选题',
- 'upload_time': '2021-12-03T14:41:31.570000',
- 'year': 2021}
- f1 = open(r"G:\zwj\WL\Text_Structure\new_tiku_structure_v3_art\struct_items.pickle", 'rb').read()
- items_list = pickle.loads(f1)
- # pprint(items_list)
- f2 = open(r"G:\zwj\WL\Text_Structure\new_tiku_structure_v3_art\svg_data.pickle", 'rb').read()
- svg_data = pickle.loads(f2)
- res = Ruku(items_list, "", svg_data, "0213441313131", {"callback_url": "1223", "source": ""}, "高中政治").upload_img()
- # a,t = Ruku("","","","").get_phy_kps_auto(one_item, 0)
- print(res)
|