123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- #!/usr/bin/env/python
- # -*- coding:utf-8 -*-
- """"
- 公式提取及整合==>加$$
- """
- import re
- def get_equation_str(item):
- """
- 1.存在公式字符串与选项一起的情况,此时,先提取选项,再公式比较好
- 2.先把题号去掉
- 3.对逗号进一步判断是否继续拆
- 4.故选:A-F 最好不要划分为公式
- :param item:
- :return:
- """
- item = re.sub(r">", '>', str(item))
- item = re.sub(r"<", '<', item)
- pattern1 = re.compile(
- r"([\da-zA-Z!\"'(*+\-\[{|#%\\><≤≥≡≦≧+-≈≠﹢﹣±㏒㏑∑∏><==×÷(△∆⊙⌒∈∩∉∪⊕∥∣≌∽∧⊥∫∬∮∯∅≮≯∁Ω→°•"
- r"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨαβγδεζνξοπρσηθικλτυφχψωμGgmst]"
- r"([\da-zA-Z!\"&'()*+,,\-../:;?\[\]{}|#%~^_`、、\\><≤≥≡≦≧+-≈≠﹢﹣±㏒㏑∑∏><==×÷()△∆⊙⌒∈∩∉∪⊕∥∣≌∽∧⊥∫∬∮∯∅≮≯∁Ω→°•′~·"
- r"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨαβγδεζνξοπρσηθικλτυφχψωμGgmst/∶∝]"
- r"|\s|\n)+)")
- pattern2 = re.compile("([!\"&'()*+,,\-../:;?\[\]{}|#%~^_`、、]|\s|\n)")
- if re.search("<sub>\s*[\u4e00-\u9fa5][\u4e00-\u9fa5、、\s]*?</sub>|\\text\s*{\s*[\u4e00-\u9fa5][\u4e00-\u9fa5、、\s]*?\}", str(item)):
- pattern1 = re.compile(
- r"([\da-zA-Z!\"'(*+\-\[{|#%\\><≤≥≡≦≧+-≈≠﹢﹣±㏒㏑∑∏><==×÷(△∆⊙⌒∈∩∉∪⊕∥∣≌∽∧⊥∫∬∮∯∅≮≯∁Ω→°•"
- r"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨαβγδεζνξοπρσηθικλτυφχψωμGgmst]"
- r"(<sub>\s*[\u4e00-\u9fa5][\u4e00-\u9fa5、、\s]*?</sub>" # add
- r"|[\da-zA-Z!\"&'()*+,,\-../:;?\[\]{}|#%~^_`、、\\><≤≥≡≦≧+-≈≠﹢﹣±㏒㏑∑∏><==×÷()△∆⊙⌒∈∩∉∪⊕∥∣≌∽∧⊥∫∬∮∯∅≮≯∁Ω→°•′~·"
- r"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨαβγδεζνξοπρσηθικλτυφχψωμGgmst/∶∝]"
- r"|\s|\n)+)")
- all_equa = [y[0] for y in re.findall(pattern1, str(item))]
- print("all_equa:", all_equa)
- right_equa = []
- for i in all_equa:
- if re.sub(pattern2, "", i):
- i = re.sub("^([1-9]|[1-5][0-9])\s*[、、]|^([1-9]|[1-5][0-9])\s*[..]$|^[))]?\s*[((][\s\d]+[))]", "", i)
- i = re.sub("^([1-9]|[1-5][0-9])\s*[、、..]\s*([((]\d*)?$", "", i)
- i = re.sub("^([1-9]|[1-5][0-9])\s*[、、..]\s*[((][\s\d]+[))]", "", i)
- i = re.sub("[(\[{、、..,,(∶]+$", "", i)
- i = re.sub("^https?://.+?$|^www\..+?$", "", i)
- i = re.sub("^[))]?\s*[((][\s\w]*[))]", "", i)
- i = re.sub("^\d+[))]|^[((]\d+$", "", i)
- i = re.sub("(\u3000)+\s*$|^\s*(\u3000)+", "", i)
- i = re.sub("\u3000", " ", i)
- i = re.sub(r"^\s*([1-9]|[1-5][0-9])\s*[..、、]\s*[A-Z]{1,3}\s*$", "", i)
- i = re.sub(r"^\s*([1-9]|[1-5][0-9])\s*[..、、]\s*([^\d])", r"\2", i)
- i = re.sub(r"^\s*[a-z][--][a-z]\s*$", '', i)
- i = re.sub(r"^\s*<[a-z]+/?>\s*$", '', i)
- i = re.sub(r"^([^((]+?)[))]$|^([^{]+?)\}$|^([^\[]+?)\]$", r'\1', i)
- i = re.sub(r"^[((]([^))]+?$)|^{([^\}]+?$)|^\[([^\]]+?$)", r'\1', i)
- def deal(yy):
- return yy.group(1).replace(",", "、").replace(",", "、")
- i = re.sub(r"^(([A-Z]\s*[,,])+[A-Z])$", deal, i)
- i = re.sub(r"^(\d+|\d+·\d+)$", "", i)
- i = re.sub(r"^[A-E]\s*[、、..,,]\s*[A-Za-z\d]$", "", i)
- i = re.sub(r"[,,]\s*[A-F]$", "", i)
- i = i.replace("G", "G").replace("g", "g").replace("m", "m").replace("s", "s").replace("/", "/").replace("=", "=")\
- .replace("2", "2").replace("F", "F").replace("t", "t").strip()
- if len(i) > 1:
- right_equa.append(i)
- return right_equa
- def get_equation_instr(item):
- """
- 先结构化,再提取公式渲染比较好!!!# 公式字符串提取再补上$$
- :param item:
- :return:
- """
- # print('///////////////原始:', item)
- item = item.replace("(", "(").replace(")", ")")
- item = re.sub(r"图(\d{1,2}[--]\d{1,2})", "图&#&"+r"\1", item)
- item = re.sub(r">", '>', str(item))
- item = re.sub(r"<", '<', item)
- item = re.sub(r"\\lt br/?>", '<br/>', item)
- item = re.sub(r"\s{2,}(</su[bp]>)", r'\1', item)
- item = re.sub(r"(<su[bp]>)\s{2,}", r'\1', item)
- # pattern1 = re.compile(r"<sub>\s*[\u4e00-\u9fa5][\u4e00-\u9fa5、、\s]*?</sub>|\\text\s*{\s*[\u4e00-\u9fa5][\u4e00-\u9fa5、、\s]*?\}")
- pattern1 = re.compile("([^\u4e00-\u9fa5;,、:①②③④\s”《》【】“))\]\}](<su[bp]>\s*[\u4e00-\u9fa5][\u4e00-\u9fa5、、\s]*?</su[bp]>"
- "|\\text\s*{\s*[\u4e00-\u9fa5][\u4e00-\u9fa5、、\s]*?\}|[_^{]\s*[\u4e00-\u9fa5][\u4e00-\u9fa5、、\s]*?"
- "|[^\u4e00-\u9fa5;“”。?①②③④]|\n)*)") # 不以xxx开头,不包含xxx
- all_equa = [y[0] for y in re.findall(pattern1, str(item))]
- # -------------按某些格式(如图片)将初步提取的公式进一步拆分-------------------
- new_all_equa = []
- for equa in all_equa:
- table_equa = re.findall("<td>(.*?)</td>", equa) # 表格内的公式
- if table_equa:
- for ta in table_equa: # 不包含图片,data-latex中肯定含有$
- new_all_equa.extend([e for e in re.split(r'<img src=[^$]*?/?>|<img src=.*? data-latex="\$\s*\$".*?/?>', ta) if e])
- else:
- equa = re.split(r'<img src=[^$]*?/?>|<img src=.*? data-latex="\$\s*\$".*?/?>|\.{7,}|=__{2,}' #
- r'|<br\s*/?>\s*[((]?\s*[1-9]\s*[))]\s*(?![+\-*/])|\s{2,}(?![+\-*/])|[((]\s*[123456]\s*[))]', equa) # ①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳
- new_all_equa.extend([e for e in equa if e])
- print("初步提取new_all_equa:", all_equa)
- # --------------将需要更改的公式提取出来,映射----------------------------------
- right_equa = {}
- for i in new_all_equa:
- raw_eqn = i
- i = re.sub(r'<img src=.+? data-latex="\$(.+?)\$"\s*/?>', "", i)
- # 只是img公式的,不需要
- if not re.sub("[((]\s*\d{1,2}\s*[))]|[${}()()。①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳【】]"
- "|</?t[hdr]>|<br\s*/?>|</?table>|</?html>|</?t?body>|</?p>", "", i).strip():
- continue
- # 简单公式,清洗一下
- # if re.match(r"\d{1,4}[.,;]*$|[A-Z]{1,2}[.,;]*$|[a-z]{1,2}[.,;]*$|(\\rm|\\mathrm)\s*[A-Z]{1,3}[\s.,;]*$"
- # r"|(\\rm|\\mathrm)\s*[A-Z][\s.,;]*[A-Z][\s.,;]*$|[A-G]\s*[、,,]\s*[A-G]$|[()\[\]{}\s\\,;.!…\d]+$",
- # re.sub("[${}()()]", "", i).strip()):
- # # i = re.sub(r"[${}]|\\rm|\\mathrm", "", raw_eqn).strip()
- # # i = re.sub(r"\\,", " ", i)
- # # if i != raw_eqn.strip():
- # # item = item.replace(raw_eqn, i, 1)
- # right_equa[raw_eqn] = "${}$".format(i)
- # print("{}----变1----${}$".format(raw_eqn, i))
- # else:
- pattern2 = re.compile("([!\"“”&'()()*+,,\-..。/::;?\[\]{}|#%~^_`、、]|\s|\n|\u3000)")
- if re.sub(pattern2, "", i):
- i = re.sub(r'<img src=.+? data-latex="\$(.+?)\$"\s*/?>', r"\1", raw_eqn)
- # 结合最开始的替换操作
- i = re.sub(r"^&#&.+?$", "", i)
- i = re.sub(r"^\.+", "", i)
- i = re.sub("^([!&),,..::;。?\]}#%、、]|\s|\n)", "", i)
- i = re.sub("^([1-9]|[1-5][0-9])\s*[、、]|^([1-9]|[1-5][0-9])\s*[..]$|^[))]?\s*[((][\s\d]+[))]", "", i)
- i = re.sub("^([1-9]|[1-5][0-9])\s*[、、..]\s*([((]\d*)?$", "", i)
- i = re.sub("^([1-9]|[1-5][0-9])\s*[、、..]\s*[((][\s\d]+[))]", "", i)
- i = re.sub("^https?://.+?$|^www\..+?$", "", i)
- i = re.sub("^[))]?\s*[((][\s\w]*[))]", "", i)
- i = re.sub("^([^((]*?)[))]", r"\1", i)
- i = re.sub("^\d+[))]|^[((]\d+$", "", i)
- i = re.sub("(\u3000)+\s*$|^\s*(\u3000)+", "", i)
- i = re.sub(r"^\s*([1-9]|[1-5][0-9])\s*[..、、]\s*[A-Z]{1,3}\s*$", "", i)
- i = re.sub(r"^\s*([1-9]|[1-5][0-9])\s*[..、、]\s*([^\d])", r"\2", i)
- # i = re.sub(r"^\s*[a-z][--][a-z]\s*$", '', i) # 'v-t', 'x-t'
- i = re.sub(r"^\s*\d{1,2}[--]\d{1,2}\s*$", '', i)
- i = re.sub(r"^\s*<[a-z]+/?>\s*$", '', i)
- i = re.sub(r"^([^((]+?)[))]$|^([^{]+?)\}$|^([^\[]+?)\]$", r'\1\2\3', i)
- i = re.sub(r"^[((]([^))]+?$)|^{([^\}]+?$)|^\[([^\]]+?$)", r'\1\2\3', i)
- i = re.sub(r"[,,]\s*[A-F]$", "", i)
- i = re.sub(r"[(\[{、、..,,(∶”?】【]+$|(<br\s*/?>)+$", "", i)
- i = re.sub(r"=[\s_]*?$", "", i)
- i = re.sub(r"^__[\s_]*?([^\s_]+?)$", r"\1", i)
- i = re.sub(r"(<br\s*/?>|\n)+?\s*$|^\s*(<br\s*/?>|\n)+?", "", i)
- i = re.sub("^[①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳]*?([^①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳]+?)"
- "[①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳]*?$", r"\1", i.strip())
- raw_eqn = i
- i = re.sub("\u3000", " ", i)
- # def deal(yy):
- # return yy.group(1).replace(",", "、").replace(",", "、")
- # i = re.sub(r"^(([A-Z]\s*[,,])+[A-Z])$", deal, i)
- # # 不渲染
- # i = re.sub(r"^(([A-Z]\s*[,,、、])+[A-Z])$", "", i) # A、B、C、D 不渲染
- # i = re.sub(r"^[A-Za-z]{2}$", "", i) # 不渲染
- # i = re.sub(r"^(\d+|\d+·\d+)$", "", i)
- # i = re.sub(r"^[A-E]\s*[、、..,,]\s*[A-Za-z\d]$", "", i)
- sub_dd = {
- "F": "F",
- "G": "G",
- "g": "g",
- "m": "m",
- "N": "N",
- "s": "s",
- "t": "t",
- "/": "/",
- "=": "=",
- "-": "-",
- "2": "2",
- "′": "'",
- # "°": "^\ciro", # \\cir后面可以随便加字母或数字
- }
- i = re.sub("|".join(sub_dd.keys()), lambda x: sub_dd[x.group()], i)
- # i = i.replace("G", "G").replace("g", "g").replace("m", "m").replace("s", "s").replace("/", "/").replace("=", "=") \
- # .replace("2", "2").replace("F", "F").replace("t", "t").replace("N","N").replace("-", "-").strip()
- # 个别不符latex格式的公式 处理
- def deal2(yy):
- new_y = yy.group(2)
- if yy.group(1) == "<sub>":
- new_y = "_{" + yy.group(2) + "}"
- if yy.group(1) == "<sup>":
- new_y = "^{" + yy.group(2) + "}"
- return re.sub("([\u4e00-\u9fa5]+)", r"\\text{\1}", new_y)
- # i = re.sub("(<sub>)(.+?)</sub>", deal2, i)
- # i = re.sub("(<sup>)(.+?)</sup>", deal2, i).strip()
- recur_n = 0
- while re.search(r"</?su[bp]>", i):
- recur_n += 1
- i = re.sub("(<sub>)(((?!</?sub>).)+?)</sub>", deal2, i)
- i = re.sub("(<sup>)(((?!</?sup>).)+?)</sup>", deal2, i)
- if recur_n > 5:
- break
- i = re.sub(r"\^{(.*?)\}\^{(.*?)\}", r"^{\1^{\2}}", i)
- if len(i) > 0: # 单个字母或数字也渲染
- new_eq = re.sub("^\$(\s+)(.+?)(?<!\s)\$$", r"\1$\2$", "${}$".format(i.replace("$", "")))
- new_eq = re.sub("^\$(?!\s)(.+?)(\s+)\$", r"$\1$\2", new_eq)
- right_equa[raw_eqn] = new_eq
- # item = item.replace(raw_eqn, "${}$".format(i), 1)
- print("{}----变2----${}$".format(raw_eqn, new_eq))
- right_equa = sorted(right_equa.items(), key=lambda x: len(x[1]), reverse=True)
- print("提取的公式整合、清洗->right_equa:",right_equa)
- # 图片替换
- all_image = re.findall(r'<img src=".*?image\d+\..*?[/\"]>', item)
- subs2src = {}
- for j, img in enumerate(all_image):
- item = item.replace(img, "【&img{}&】".format(j))
- subs2src["【&img{}&】".format(j)] = img
- temp_map = {}
- for n, eq in enumerate(right_equa):
- if eq[0] not in ["e1", "e2","e3", "e4", "e5", "e6", "e7", "e8", "e9"]:
- if eq[0] not in "http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zyk/uploadfiles/wording/new_image59.png"\
- or len(eq[0]) < 3:
- if re.search("^(\d+|[img]+)$", eq[0]) is None:
- item = item.replace(eq[0], "#&{}&#".format(n))
- # else:
- # item = re.sub("(?<!#&)" + eq[0], "#&{}&#".format(n), item)
- # item = re.sub(r"(#&.+?&#)", lambda x: x.group(1).replace("$", ""), item) # 无效
- temp_map["#&{}&#".format(n)] = eq[1]
- # print("temp_map:", temp_map)
- for k, v in subs2src.items():
- item = item.replace(k, v)
- for k, v in temp_map.items():
- item = re.sub(r"#&.+?&#", lambda x: x.group().replace("$", ""), item)
- item = item.replace(k, v)
- for k, v in temp_map.items():
- # item = re.sub(r"#&.+?&#", lambda x: x.group().replace("$", ""), item)
- item = item.replace(k, v)
- # print("res:", item)
- return item
- def get_simpstr2eqn(item):
- "将简单的数字转为公式,加$"
- item = re.sub(r"^\n*([\dA-Za-z][A-Za-z\d\s]*)(\n*)$", r"$\1\2$", item)
- # item = re.sub(r"([\u4e00-\u9fa5]\s*|<img.*?/>\s*|^\n*)([\dA-Za-z][A-Za-z\d\s]*)([\u4e00-\u9fa5]|<img|\n*$)",
- # r"\1$\2$\3", item)
- return item
- if __name__ == '__main__':
- # import pandas as pd
- # from formula_extract_lqy2 import formula_extract_lqy
- #
- # pp = r"F:\zwj\WL\phy\wordbin2.0\data\WL_train.xlsx"
- # df = pd.read_excel(pp)
- # df['equations'] = df['item'].apply(get_equation_str)
- # df['equations2'] = df['item'].apply(get_equation_str2)
- # df['equations3'] = df['item'].apply(formula_extract_lqy)
- # flag = []
- # new_flag = []
- # for index, row in df.iterrows():
- # # print(row['equations2'])
- # # print(row['equations'])
- # # print(len(row['equations2']), len(row['equations']))
- # # print("".join(row['equations2']) == "".join(row['equations']))
- # # print('===========================')
- # if row['equations2'] == row['equations']:
- # flag.append(1)
- # else:
- # flag.append(0)
- # if row['equations3'] == row['equations']:
- # new_flag.append(1)
- # else:
- # new_flag.append(0)
- # df['flag'] = flag
- # df['new_flag'] = new_flag
- # df.to_excel(r"F:\zwj\WL\phy\wordbin2.0\data\WL_train4.xlsx")
- tt1 = """
- 下列物质与危险化学品标志的对应关系不正确的是<br/><table><tr><td>A</td><td>B</td><td>C</td><td>D</td></tr><tr><td>汽油</td><td>天然气</td><td>浓硫酸</td><td>氢氧化钠</td></tr><tr><td><img src="files/image2.png" width="125px" height="116px" /></td><td><img src="files/image3.png" width="117px" height="117px" /></td><td><img src="files/image4.png" width="118px" height="119px" /></td><td><img src="files/image5.png" width="122px" height="118px" /></td></tr></table>
- """
- tt2 = 'Ag<sup>+</sup>、K<sup>+</sup>、NO<img src="files/image6.png" width="11px" height="25px" data-latex="$$" />、C1<sup>-</sup>'
- tt3 = 'Mg<sup>2</sup><sup>+</sup>、Na<sup>+</sup>、Cl<sup>-</sup>、SO<img src="files/image7.png" width="16px" height="24px" data-latex="$$" />'
- tt4 = 'NH<img src="files/image8.png" width="11px" height="24px" data-latex="$$" />、Cu<sup>2</sup><sup>+</sup>、OH<sup>一</sup>、Cl<sup>—</sup>'
- tt5 = 'H<sup>+</sup>、Na<sup>+</sup>、HCO<img src="files/image9.png" width="11px" height="25px" data-latex="$$" />、SO<img src="files/image10.png" width="16px" height="24px" data-latex="$$" />'
- tt6 = '向MgSO<sub>4</sub>和Al<sub>2</sub>(SO<sub>4</sub>)<sub>3</sub>的混合溶液中,逐滴加入NaOH溶液。下列图像中, 能正确表示上述反应的是(横坐标表示加入NaOH溶液的体积,纵坐标表示反应生成沉淀的质量) ( )<br/>【未识别图片】'
- tt7 = '把一定量铁粉放入氯化铁溶液中,完全反应后,所得溶液中Fe<img src="files/image11.png" width="7px" height="20px" /><img src="files/image12.png" width="7px" height="20px" />和Fe<img src="files/image13.png" width="7px" height="20px" /><img src="files/image12.png" width="7px" height="20px" />的浓度恰好相等.则已反应的Fe<img src="files/image13.png" width="7px" height="20px" /><img src="files/image12.png" width="7px" height="20px" />和未反应的Fe<img src="files/image13.png" width="7px" height="20px" /><img src="files/image12.png" width="7px" height="20px" />的物质的量之比为( )'
- tt8 = '下列物质中既能跟稀H<sub>2</sub>SO<sub>4</sub>反应,又能跟氢氧化钠溶液反应的是( )。<br/>①NaHCO<sub>3 </sub>②Al<sub>2</sub>O<sub>3 </sub>③Al(OH)<sub>3 </sub> ④Al'
- tt9 = 'M<sub>2</sub>O <sub>7</sub> <sup>x-</sup>与S<sup>2-</sup> 在酸性溶液中发生如下反应:M<sub>2</sub>O<sub>7</sub><sup>x</sup><sup>-</sup>+3S<sup>2</sup><sup>-</sup>+14H<sup>+</sup>=2M<sup>3+</sup>+3S↓+7H<sub>2</sub>O<br/>则M<sub>2</sub>O<sub>7</sub><sup>x</sup><sup>-</sup> 中M 的化合价为( )'
- tt10 = 'AlCl<sub>3</sub>溶液中加入足量的氨水:Al<img src="files/image13.png" width="7px" height="20px" /><img src="files/image12.png" width="7px" height="20px" />+3OH<img src="files/image15.png" width="11px" height="20px" />═Al(OH)<sub>3</sub>↓'
- tt11 = 'FeCl<sub>2</sub>溶液跟Cl<sub>2</sub>反应:Fe<sup>2+</sup>+Cl<sub>2</sub>=Fe<sup>3+</sup>+2Cl<sup>-</sup>'
- tt12 = '实验室中需要配制2 mol/L的NaCl溶液950 mL,配制时应选用的容量瓶的规格和称取的NaCl的质量分别是( )'
- tt13 = '现有下列10种物质:①H<sub>2</sub>O ②空气 ③Al ④明矾 ⑤H<sub>2</sub>SO<sub>4</sub> ⑥烧碱 ⑦CuSO<sub>4</sub>•5H<sub>2</sub>O ⑧碘酒 ⑨C<sub>2</sub>H<sub>5</sub>OH ⑩ 纯碱(1)属于碱的是 ;属于盐的是 ;属于电解质的是 (填写序号)。<br/>(2)④明矾的化学式为 ,向④的溶液中滴加过量⑥溶液反应离子方程式为<br/>(3)⑤的溶液与⑩的溶液反应离子方程式为'
- tt14 = '(17分)(1)Fe<sub>2</sub>O<sub>3</sub>+6H<sup>+</sup>═2Fe<sup>3+</sup>+3H<sub>2</sub>O;<br/>(2)NaOH溶液;<br/>(3)Fe+2FeCl<sub>3</sub>═3FeCl<sub>2</sub>;<br/>(4)4Fe(OH)<sub>2</sub>+O<sub>2</sub>+2H<sub>2</sub>O═4Fe(OH)<sub>3</sub>;(5)氢氧化铁胶体 粒子直径大小 生成白色沉淀,迅速变成灰绿色,最终变成红褐色;<br/>1718.17(1)题中通入CO<sub>2</sub>后所得溶液的溶质成分为Na<sub>2</sub>CO<sub>3</sub>和NaHCO<sub>3</sub>,若将所得溶质在低温低压条件下蒸干,所得固体物质(不带结晶水)的质量为13.7g.<br/>(2)原NaOH溶液的物质的量浓度为2mol/L;<br/></body></html>'
- p1 = '“天舟一号”是我国首个货运飞船,被大家昵称为“快递小哥”,于2017年4月20发射成功。4月22日“天舟一号”与在轨运行的“天宫二号”空间实验室进行首次交会对接,形成组合体。 要实现“天舟一号”与 “天宫二号”成功对接 ,则'
- p2 = '(1)小球p从斜面上下滑的加速度为a,由牛顿第二定律有:<br/><img src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zyk/uploadfiles/wording/5fc64aca4994183dda7e751b/image59.png" width="93px" height="21px" data-latex="$$"> ..............................................................................................................(2分)<br/>设下滑所需时间为t<sub>1</sub>,根据运动学公式有:<br/><img src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zyk/uploadfiles/wording/5fc64aca4994183dda7e751b/image60.png" width="52px" height="37px" data-latex="$$"> ..........................................................................................................................(2分)<br/>联立解得:t<sub>1</sub> =0.5 s .........................................................................................................(1分)<br/>(2)小球q做平抛运动,设抛出速度为v<sub>0</sub>,则:<br/><img src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zyk/uploadfiles/wording/5fc64aca4994183dda7e751b/image61.png" width="46px" height="20px" data-latex="$$">............................................................................................................................(2分)<br/>由几何关系知:x=lcos37° .............................................................................................(1分)<br/>依题意有: t<sub>2</sub>=t<sub>1</sub> .............................................................................................................(1分)<br/>解得: v<sub>0</sub>=1.2<img src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zyk/uploadfiles/wording/5fc64aca4994183dda7e751b/image62.png" width="34px" height="18px" data-latex="$$"> ...................................................................................................... (1分)'
- p3 = '则该金属丝直径的测量值d=___________mm。<br/><img src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zyk/uploadfiles/wording/6167c1360d2da861d11c950a/image31.png" width="262px" height="146px" /><img src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zyk/uploadfiles/wording/6167c1360d2da861d11c950a/image32.jpeg" width="162px" height="137px" /><br/>(2)使用多用电表欧姆挡粗测金属丝的电阻,倍率选择“×10”挡,发现指针偏转角度太大了,下列说法不正确的是( )'
- p4 = '电流表A(量程为0~0.6 A,内阻约0.5 Ω)'
- p5 = '''
- 为测定干电池的电动势和内阻,提供的实验器材如下所示:
- A.干电池2节,每节干电池的电动势为1.5 V<img src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zyk/uploadfiles/wording/6167c1360d2da861d11c950a/image34.png" width="26px" height="26px">左右,内阻较小
- B.电流表A(量程为0~0.6 A,内阻约0.5 Ω)
- C.滑动变阻器R1(0~10 Ω,10 A)D.滑动变阻器R2(0~100 Ω,1 A)
- E.电流表G(0~3.0 mA,Rg=10 Ω)F.定值电阻R1=990 Ω
- G.定值电阻R2=90 ΩH.开关S和导线若干
- (1)由于两节干电池的内阻较小,现将定值电阻R0=3.0 Ω与两节干电池串联后作为一个整体进行测量。在进行实验时,滑动变阻器应选用________,定值电阻应选用________。(填写实验器材前的编号)
- (2)在虚线方框中补充完整本实验电路的原理图。
- <img src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zyk/uploadfiles/wording/6167c1360d2da861d11c950a/image35.png" width="382px" height="144px">
- (3)根据实验测得数据作出I2-I1的图线如图,其中I2为通过电流表G的电流,I1为通过电流表A的电流.根据该图线可知每节干电池的电动势的测量值为________V,内阻的测量值为________Ω。(结果保留两位有效数字)
- '''
- p6 = '''
- 20.如图所示,xOy平面内半径为R的圆O'与y轴相切于原点O。在该圆形区域内,有与y轴平行的匀强电场和垂直于圆面的匀强磁场。一质量为m、电荷量为q的粒子(不计重力)从O点沿x轴正方向以某一速度射入,带电粒子恰好做匀速直线运动,经T0时间从P点射出。
- (1)若仅撤去磁场,带电粒子仍从O点以相同的速度射入,经<img src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zyk/uploadfiles/wording/6167c1360d2da861d11c950a/image38.png" width="20px" height="37px" data-latex="$$">时间恰从圆形区域的边界射出。求电场强度的大小和粒子离开电场时速度的大小;
- (2)若仅撤去电场,带电粒子仍从O点射入,且速度为原来的2倍,求粒子在磁场中运动的时间。
- '''
- res = get_equation_instr(p6)
- print("res:-----------------")
- print(res)
|