sci_clear.py 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. # encoding=utf-8
  2. import os
  3. import sys
  4. sys.path.append(os.getcwd())
  5. import os
  6. import re
  7. import unicodedata
  8. from bs4 import BeautifulSoup
  9. from main_clear.latex2maple.latex2maple import structured
  10. # tjt新增修改(针对页面渲染直接取出data-latex导致清洗出错进行特殊处理)
  11. # '$'特殊处理(方法一)
  12. def non_data_latex_replace(s):
  13. s = s.replace("\(","$")
  14. s = s.replace("\)","$")
  15. s_doll = s.replace("$", "$$")
  16. s_list = s_doll.split('$')
  17. s_list_len = len(s_list)
  18. if s_list_len == 1:
  19. return s
  20. i = 0
  21. # ['文本','','公式','','数字','','','公式','']->找空字符串去处理被''包围"公式"和"数字"
  22. while i < s_list_len:
  23. if s_list[i] == '':
  24. if i+2 < s_list_len and s_list[i+1] != '' and s_list[i+2] == '':
  25. s_list[i+1] = structured(s_list[i+1].replace('%20', ' ').replace('%3C', '<').replace('%3E', '>'))
  26. i += 2
  27. i += 1
  28. return ''.join(s_list)
  29. # '$'特殊处理(方法二)
  30. def non_data_latex_iter(s):
  31. s = s.replace("\(","$")
  32. s = s.replace("\)","$")
  33. s_doll = s.replace("$", "$$")
  34. s_list = s_doll.split('$')
  35. s_list_len = len(s_list)
  36. if s_list_len == 1:
  37. return s
  38. # ['文本','','公式','','数字','','','公式','']->找被空字符''包围的"公式"和"数字"进行处理
  39. # 要先判断索引是否满足长度要求
  40. s_list = [structured(ele.replace('%20', ' ').replace('%3C', '<').replace('%3E', '>'))
  41. if (i+1)<s_list_len and i>0 and ele!='' and s_list[i-1]=='' and s_list[i+1]=='' else ele
  42. for i, ele in enumerate(s_list)]
  43. return ''.join(s_list)
  44. # '$'特殊处理(方法三)
  45. def non_data_latex_regexp(s):
  46. s = s.replace("\(","$")
  47. s = s.replace("\)","$")
  48. re_list = re.findall(r"\$.*?\$", s)
  49. if len(re_list) > 0:
  50. latex_list = [ele for ele in re_list if ele.strip() != '']
  51. if len(latex_list) == len(re_list):
  52. latex_list = [structured(ele.replace('%20', ' ').replace('%3C', '<').replace('%3E', '>'))
  53. for ele in latex_list]
  54. for i in range(len(latex_list)):
  55. s = s.replace(re_list[i], latex_list[i], 1)
  56. return s
  57. # 转义字符特殊处理
  58. def escape_func(s):
  59. # 转义字符转换
  60. s = s.replace("\a", "\\a")
  61. s = s.replace("\b", "\\b")
  62. s = s.replace("\f", "\\f")
  63. s = s.replace("\n", "\\n")
  64. s = s.replace("\r", "\\r")
  65. s = s.replace("\t", "\\t")
  66. s = s.replace("\v", "\\v")
  67. # 部分指令特殊处理
  68. s = s.replace(r'\[', '')
  69. s = s.replace(r'\]', '')
  70. s = s.replace(r"\lt", "<")
  71. s = s.replace(r"\gt", ">")
  72. s = s.replace(r'\theta', 'θ')
  73. s = s.replace(r'\a*rg', 'arg')
  74. s = s.replace(r'\leftrightarrow', '↔')
  75. s = s.replace(r'\Leftrightarrow', '⇔')
  76. s = s.replace(r'\rightleftharpoons', '⇌')
  77. s = s.replace(r'\leftharpoonup', '↼')
  78. s = s.replace(r'\rightharpoonup', '⇀')
  79. s = s.replace(r'\leftharpoondown', '↽')
  80. s = s.replace(r'\rightharpoonupdown', '⇁')
  81. s = s.replace(r'\leftarrow', '←')
  82. s = s.replace(r'\Leftarrow', '⇐')
  83. s = s.replace(r'\rightarrow', '→') # 前面要加上r,否则结果显示替换不成功
  84. s = s.replace(r'\Rightarrow', '⇒')
  85. s = s.replace(r'\right', '') # 前面要加上r,否则结果显示替换不成功
  86. s = s.replace(r'\left', '')
  87. # 向量特殊处理
  88. s = s.replace("overleftarrow", "overrightarrow")
  89. # 分号(/)特殊处理
  90. s = s.replace("dfrac", "frac")
  91. return s
  92. def get_maplef_items(html):
  93. html = re.sub('(latex=".*?")', lambda x: x.group(1).replace("\n", ""), html, flags=re.S)
  94. html = escape_func(html)
  95. soup = BeautifulSoup(html, features="lxml")
  96. s = ''
  97. for i in soup.prettify().split('\n'):
  98. if i.strip().startswith('<img'):
  99. s2 = BeautifulSoup(i, features="lxml")
  100. if s2.img:
  101. s3 = s2.img.get('latex')
  102. s3 = s3 if s3 else s2.img.get('data-latex')
  103. if s3:
  104. s += structured(s3.replace('%20', ' ').replace('%3C', '<').replace('%3E', '>'))
  105. else:
  106. s3 = s2.img.get('src')
  107. if not s3:
  108. continue
  109. if len(s3.split('?')) == 2:
  110. s3 = s3.split('?')[-1]
  111. elif 'class="tiankong"' in i:
  112. s += '____'
  113. s3 = ''
  114. else:
  115. s3 = 'img'
  116. s += structured(s3.replace('%20', ' ').replace('%3C', '<').replace('%3E', '>'))
  117. elif i.strip().startswith('<'):
  118. pass
  119. else:
  120. s += i
  121. # tjt新增修改(针对页面渲染直接取出data-latex导致清洗出错进行特殊处理)
  122. try:
  123. s = non_data_latex_iter(s)
  124. except Exception as e:
  125. try:
  126. s = non_data_latex_regexp(s)
  127. except Exception as e:
  128. pass
  129. # 结果显示替换不成功
  130. s = re.sub(r'\s', " ", s)
  131. s = re.sub(r"(begin|end){?(gathered|array)", "", s)
  132. s = s.replace("&lt;", "<")
  133. s = s.replace("&gt;", ">")
  134. s = s.replace('%20', '')
  135. s = s.replace('%3E', '>')
  136. s = s.replace('%3C', '<')
  137. s = s.replace('img', '')
  138. s = s.replace('$', '')
  139. s = s.replace('mathbf', '')
  140. s = s.replace('operatornamem', '')
  141. s = s.replace('beginarra*y', '')
  142. # s = s.replace('endarra*y', '')
  143. s = s.replace('slant', '')
  144. s = s.replace('endarra*y', '')
  145. s = s.replace('hfill', '')
  146. s = s.replace('#', '')
  147. # 结果显示替换不成功
  148. s = s.replace('\n', '')
  149. s = s.replace('\r', '')
  150. s = s.replace(r'①', '(1)、')
  151. s = s.replace(r'②', '(2)、')
  152. s = s.replace(r'③', '(3)、')
  153. s = s.replace(r'④', '(4)、')
  154. s = s.replace(r'⑤', '(5)、')
  155. s = s.replace(r'⑥', '(6)、')
  156. s = s.replace(r'⑦', '(7)、')
  157. s = s.replace(r'⑧', '(8)、')
  158. s = s.replace(r'⑨', '(9)、')
  159. s = s.replace(r'⑩', '(10)、')
  160. s = re.sub(r'/images/1-50/[1-9].gif', '( )', s)
  161. s = re.sub(r'/([0-9a-z/*.]*?)(png|jpg|gif)', 'img', s)
  162. s = unicodedata.normalize('NFKC', s) # 中文符号转换成英文
  163. # s = s.replace(",", ",").replace(":", ":").replace(";", ";").replace("“", "'").replace("”", "'"). \
  164. # replace("?", "?").replace("!", "!").replace("。", ",").replace("(", "(").replace(")", ")"). \
  165. # replace(".", ".").replace("【", "[").replace("】", "]")
  166. # tjt修改支持"= ."或"=___."处理
  167. s = re.sub(r"[==][ _]*\.?$", "等于多少", s)
  168. # tjt注释
  169. # s = re.sub(r"[==]\s*(\(\s*\)|_+|(\s*))\.?", "等于多少", s)
  170. # s = re.sub(r"[==]\.?$", "等于多少", s)
  171. s = re.sub(r"\(\s*[??]*\s*\)|(\s*[??]*\s*)\.?$", "", s)
  172. s = re.sub(r"(为|是|等于|=|=)img\.?$", "等于多少", s)
  173. s = re.sub(r"img(为|是|等于|=|=)\.?$", "等于多少", s)
  174. s = re.sub(r"[fFGg]\^\(-1\)\*\(.*?\)", "反函数_y", s)
  175. s = s.replace("图像", "图象")
  176. s = s.replace("椭圆", "椭椭")
  177. s = s.replace("⇒", "所以")
  178. s = re.sub(r'img$', '', str(s))
  179. s = re.sub(r"[==]\s*(\(\s*\)|_{1,5}|(\s*))", "等于多少", s)
  180. s = re.sub(r"\(\s*[??]*\s*\)|(\s*[??]*\s*)$", "", s)
  181. s = re.sub(r"(为|是|等于)img$", "等于多少", s)
  182. # s = re.sub(r"([A-Za-z0-9])'", r"\1", s)
  183. s = re.sub(r"over(right|left)arrow", "向量", s)
  184. s = re.sub(r"[Vv]e\*?nn", "韦恩", s)
  185. s = re.sub(r"\^['′]", "'", s)
  186. # tjt修改
  187. s = s.replace("×", "*")
  188. s = s.replace("*", '')
  189. s = s.replace("%%", '')
  190. s = s.replace('\\n', '')
  191. s = s.replace('\\r', '')
  192. s = s.replace("^°", "°")
  193. s = re.sub(r"°\^([Cc])", r"°\1", s)
  194. s = re.sub(r"([0-9])\)°([^Cc])", r"\1°)\2", s)
  195. # tjt修改支持"= ."或"=___."处理
  196. s = re.sub(r"[==][ _]*\.?$", "等于多少", s)
  197. return s
  198. if __name__ == "__main__":
  199. # print(structured( r'$z = \left( {{m^2} - 5m + 6} \right) + \left( {m - 3} \right)i$'))
  200. # li = ['<p><img src="/data/word/wordimg/2019/05/5ce6485c56f42.png" style="width: 36pt; height: 21.6pt" data-type="math" data-latex="\\[y = {e^x}\\]" width="48" height="29"/></p>', '<p><img src="/data/word/wordimg/2019/05/5ce6485c58025.png" style="width: 64.8pt; height: 28.8pt" data-type="math" data-latex="\\[y = - {\\log _{\\frac{1}{\\pi }}}x\\]" width="86" height="38"/></p>', '<p><img src="/data/word/wordimg/2019/05/5ce6485c5910a.png" style="width: 43.2pt; height: 21.6pt" data-type="math" data-latex="\\[y = \\sqrt x \\]" width="58" height="29"/></p>', '<p><img src="/data/word/wordimg/2019/05/5ce6485c5a2b1.png" style="width: 57.6pt; height: 28.8pt" data-type="math" data-latex="\\[y = {\\log _{\\frac{1}{2}}}x\\]" width="77" height="38"/></p>']
  201. #
  202. s= r"""<article><p>Have you ever wondered how your favorite NBA team received its famous name? All NBA teams have an interesting story or a history behind their names. Some of the names reflect the city's culture or history, others came from previous owners and many were selected through "Name the Team" contests.<br/>For teams like Los Angeles and Utah, the names were not always a reflection of the city. Even though Los Angeles has no lakes, the Laker name has been a city treasure for almost 40 years. Before going to Los Angeles, the team originated in Minneapolis, Minnesota. In 1948, team officials chose the name for its direct relationship to the state's motto, "The Land of 10,000 Lakes." The team name went unchanged after moving to Los Angeles in 1960.<br/>Because Utah's team originated in New Orleans, Louisiana, it was called the Jazz. In 1974, New Orleans club officials chose the name to represent the city for its reputation as the "jazz capital of the world." The name stayed with the team even after finding a new home in Salt Lake City, Utah in 1979.<br/>The Chicago Bull's original owner, Richard Klein, named the team the Bulls. He picked the name because a fighting bull is relentless, and never quits. Klein, who founded the club in1966, believed these qualities were necessary for a championship team and hoped his Chicago athletes would live up to the team name. A belief that Bulls—winner of the six NBA championships— have definitely followed.<br/>In 1967, the Indian Pacers selected their team name in a different way from most other teams. Their decision was based on what they wanted to accomplish in the NBA. Team officials chose the Pacers name because the organization wanted to set the "pace" in professional basketball.<br/></p></article>"""
  203. # from requests_toolbelt import MultipartEncoder
  204. # import requests
  205. # print(requests.post('http://192.168.1.145:8086/math_data_clean',data = {'item':s}).json())
  206. #
  207. # for s in li:
  208. s="""<p>如图,已知<img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/c0b6d5bb7d966f18ef9353138f6352cc.png" style="width: 65.25pt; height: 14.25pt" data-type="math" data-latex="$\angle AOB = 40^\circ $" width="87" height="19" />,<img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/5dd55320d1a52d7d34b2fd5e94433c8c.png" style="width: 87.75pt; height: 14.25pt" data-type="math" data-latex="$\angle BOC = 3\angle AOB$" width="117" height="19" />,<img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/c1664fb157b79a64d991d7c77af335d7.png" style="width: 21pt; height: 14.25pt" data-type="math" data-latex="$OD$" width="28" height="19" />平分<img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/480718502d54647275c7fe8ac58bac75.png" style="width: 36.75pt; height: 14.25pt" data-type="math" data-latex="$\angle AOC$" width="49" height="19" />,求<img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/d2d28e3733589e90a99a8391c54171ff.png" style="width: 38.25pt; height: 14.25pt" data-type="math" data-latex="$\angle COD$" width="51" height="19" />的度数.</p><p>解:<img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/e18901783e1f03c948bd1a1f617912cf.png" style="width: 72.75pt; height: 14.25pt" data-type="math" data-latex="$\because \angle BOC = 3\angle $" width="97" height="19" />______,<img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/47a2d20361dc34d3d372d485f4f8a9f7.png" style="width: 65.25pt; height: 14.25pt" data-type="math" data-latex="$\angle AOB = 40^\circ $" width="87" height="19" />,</p><p><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/92a7bd71a095ca92577acd42e4cab402.png" style="width: 56.25pt; height: 14.25pt" data-type="math" data-latex="$\therefore \angle BOC = $" width="75" height="19" />______<img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/414575fac3ad1e5fb552f948f76c54ac.png" style="width: 8.25pt; height: 12.75pt" data-type="math" data-latex="$^\circ $" width="11" height="17" />,</p><p><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/c35b0bafb0d67ef84b9d8cc60afdc724.png" style="width: 56.25pt; height: 14.25pt" data-type="math" data-latex="$\therefore \angle AOC = $" width="75" height="19" />______<img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/eef861150281f1cf1a5ce7cd013a7995.png" style="width: 11.25pt; height: 11.25pt" data-type="math" data-latex="$ + $" width="15" height="15" />______,</p><p><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/de740a6139e9045a39fe4820ca34fa2d.png" style="width: 80.25pt; height: 14.25pt" data-type="math" data-latex="$\therefore \angle AOC = 160^\circ $" width="107" height="19" /></p><p><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/2af5afb7e01160519ad998abe0993af1.png" style="width: 30.75pt; height: 14.25pt" data-type="math" data-latex="$\because OD$" width="41" height="19" />平分<img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/b81f079120974bc8ef9736e4c574353c.png" style="width: 36.75pt; height: 14.25pt" data-type="math" data-latex="$\angle AOC$" width="49" height="19" /></p><p><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/c3551758644fd7c37d9e127b0936448f.png" style="width: 57pt; height: 14.25pt" data-type="math" data-latex="$\therefore \angle COD = $" width="76" height="19" />______<img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/ca6337eef25ff570fb1de161ef162948.png" style="width: 9.75pt; height: 9pt" data-type="math" data-latex="$ = $" width="13" height="12" />______<img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/7c4334acc724beee1f283a162be5e1d6.png" style="width: 8.25pt; height: 12.75pt" data-type="math" data-latex="$^\circ $" width="11" height="17" />.</p><p><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/teacher/uploadfiles/wording/0/2022/07/28/edf70a69a16fe0a1e9e69467f4a90c7e.png" style="width: 2.270833in; height: 1.246731in" width="218" height="120" /></p>"""
  209. s="""<p><span style="font-variant-ligatures: normal; orphans: 2; widows: 2;">为确保信息安全,信息需加密传输,发送方由明文</span><img width="15" height="9" src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zsytk/topic/image/2022/08/05/1659694400394379.gif?%20\to" class="gsImgLatex mathType" style="font-variant-ligatures: normal; orphans: 2; white-space: normal; widows: 2; vertical-align: middle;"/><span style="font-variant-ligatures: normal; orphans: 2; widows: 2;">密文(加密),接收方由密文</span><img width="15" height="9" src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zsytk/topic/image/2022/08/05/1659694400394379.gif?%20\to" class="gsImgLatex mathType" style="font-variant-ligatures: normal; orphans: 2; white-space: normal; widows: 2; vertical-align: middle;"/><span style="font-variant-ligatures: normal; orphans: 2; widows: 2;">明文(解密),已知加密规则为:明文</span><img width="54" height="15" src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zsytk/topic/image/2022/08/05/1659694401424587.gif?a,b,c,d" class="gsImgLatex mathType" style="font-variant-ligatures: normal; orphans: 2; white-space: normal; widows: 2; vertical-align: middle;"/><span style="font-variant-ligatures: normal; orphans: 2; widows: 2;">对应密文</span><img width="179" height="15" src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zsytk/topic/image/2022/08/05/1659694401118594.gif?a%20+%202b,2b%20+%20c,2c%20+%203d,4d" class="gsImgLatex mathType" style="font-variant-ligatures: normal; orphans: 2; white-space: normal; widows: 2; vertical-align: middle;"/><span style="font-variant-ligatures: normal; orphans: 2; widows: 2;">.例如,明文</span><img width="54" height="15" src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zsytk/topic/image/2022/08/05/1659694401275521.gif?1,2,3,4" class="gsImgLatex mathType" style="font-variant-ligatures: normal; orphans: 2; white-space: normal; widows: 2; vertical-align: middle;"/><span style="font-variant-ligatures: normal; orphans: 2; widows: 2;">对应密文</span><img width="71" height="15" src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zsytk/topic/image/2022/08/05/1659694401650019.gif?5,7,18,16" class="gsImgLatex mathType" style="font-variant-ligatures: normal; orphans: 2; white-space: normal; widows: 2; vertical-align: middle;"/><span style="font-variant-ligatures: normal; orphans: 2; widows: 2;">.当接收文收到密文</span><img width="79" height="15" src="http://zxhx-1302712961.cos.ap-shanghai.myqcloud.com/zsytk/topic/image/2022/08/05/1659694401264806.gif?14,9,23,28" class="gsImgLatex mathType" style="font-variant-ligatures: normal; orphans: 2; white-space: normal; widows: 2; vertical-align: middle;"/><span style="font-variant-ligatures: normal; orphans: 2; widows: 2;">,解密得到的明文为( &nbsp; )</span></p>"""
  210. s="""<p><img src=\"http://tkimgs.zhixinhuixue.net/image/word/2021/05/05/1620215474707966.png\" data-latex=\"${G\\dfrac{{m}_{1}{m}_{2}}{{r}^{2}}}$\" width=\"60\" height=\"29\"/></p>"""
  211. s="""<html><head><meta charset=\"utf-8\" /></head><body>\n<p>【题文】如图所示,△ABC为正三角形,在A、B两点放有两点电荷,结果C点的合场强大小为E,方向垂直于CB边斜向上,CD是AB边的垂线,D是垂足,则下列说法正确的是(  )</p>\n<p><img src=\"http://192.168.1.198:8800/ser_static/1665992538990530/word/media/image1.png\" width=\"142px\" height=\"168px\" /></p>\n<p>A.A 为正电荷,B为负电荷,A点电荷的电荷量是B点电荷量的2倍</p>\n<p>B.若撤去A点的电荷,则C点的电场强度大小为$\\frac{\\sqrt{3}}{3}$E</p>\n<p>C.C点电势高于D点电势,若取无穷远处电势为零,则C点的电势为正</p>\n<p>D.将一正点电荷从D点沿直线移到C点,电势能一直减小</p>\n<p>【答案】ABD</p>\n<p>【解析】</p>\n<p>【详解】</p>\n<p>A.由于C点的场强是由A、B两点的点电荷产生的场强叠加而成,根据平行四边形定则和点电荷场强的特点可知,如图所示,可以判断E<sub>A</sub>背离A点,E<sub>B</sub>指向B点,所以A点为正电荷,B点为负电荷,A,B点电荷在C点产生的场强大小分别为</p>\n<p>EA=$\\frac{2\\sqrt{3}}{3}$E</p>\n<p>EB=$\\frac{\\sqrt{3}}{3}$E</p>\n<p>设三角形的边长为L,由点电荷的场强公式可知</p>\n<p>EA=k$\\frac{{q}_{A}}{{L}^{2}}$</p>\n<p>EB=k$\\frac{{q}_{B}}{{L}^{2}}$</p>\n<p>则</p>\n<p>qA=2qB</p>\n<p>A正确;</p>\n<p><img src=\"http://192.168.1.198:8800/ser_static/1665992538990530/word/media/image6.png\" width=\"160px\" height=\"211px\" /></p>\n<p>B.若撤去A点的电荷,则C点的电场强度大小为</p>\n<p>EB=$\\frac{\\sqrt{3}}{3}$E</p>\n<p>B正确;</p>\n<p>C.设qB=﹣q,qA=+2q,将A点的电荷看成两个+q电荷的叠加,则其中一半与B点的电荷是等量异种电荷,还剩一半是正点电荷,因为等量异种电荷中垂线是等势线,延伸到无穷远,由题意可知,中垂线上的电势就相当于A点剩下的+q在中垂线上的电势,为正,且离A点越近,电势越高,C错误;</p>\n<p>D.同理,正电荷在中垂线上从D点向C点运动时,相当于只有A点剩下的+q对其做正功,电势能一直减小,D正确。</p>\n<p>故选ABD。</p>\n<p>【题型】290104</p>\n<p>【难度】3</p>\n<p>【结束】</p>\n</body></html>"""
  212. s="""<p style=""><img width="30" height="17" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844920236033.gif?f(x)" class="gsImgLatex mathType"/>的对称轴为<img width="55" height="30" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844920186481.gif?x%20=%20%20-%20\frac{a}{2}" class="gsImgLatex mathType"/>.</p><p style="">当<img width="67" height="30" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844920415549.gif?%20-%20\frac{a}{2}%20\le%20%20-%201" class="gsImgLatex mathType"/>,即<img width="38" height="14" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844920967586.gif?a%20\ge%202" class="gsImgLatex mathType"/>,<img width="156" height="17" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844920509513.gif?g(a)%20=%20f(%20-%201)%20=%204%20-%20a" class="gsImgLatex mathType"/>,<img width="112" height="17" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844920619161.gif?g(a)%20\le%20g(2)%20=%202" class="gsImgLatex mathType"/>;</p><p style="">当<img width="97" height="30" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844920289570.gif?%20-%201%20%3C%20%20-%20\frac{a}{2}%20%3C%201" class="gsImgLatex mathType"/>,即<img width="81" height="12" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844920958390.gif?%20-%202%20%3C%20a%20%3C%202" class="gsImgLatex mathType"/>,<img width="175" height="30" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844920273613.gif?g(a)%20=%20f(%20-%20\frac{a}{2})%20=%203%20-%204{a^2}" class="gsImgLatex mathType"/>,<img width="119" height="17" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844921415838.gif?%20-%2013%20%3C%20g(a)%20\le%2013" class="gsImgLatex mathType"/>;</p><p style="">当<img width="54" height="30" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844921605985.gif?%20-%20\frac{a}{2}%20\ge%201" class="gsImgLatex mathType"/>,即<img width="51" height="14" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844921844174.gif?a%20\le%20%20-%202" class="gsImgLatex mathType"/>,<img width="143" height="17" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844921541499.gif?g(a)%20=%20f(1)%20=%204%20+%20a" class="gsImgLatex mathType"/>,<img width="125" height="17" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844921696725.gif?g(a)%20\le%20g(%20-%202)%20=%202" class="gsImgLatex mathType"/>,(如图)</p><p style=""><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844921188855.png" style="vertical-align: middle;" width="226" height="197" /><br/></p><p style="">综上所述,<img width="29" height="17" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844921142317.gif?g(a)" class="gsImgLatex mathType"/>的值域为<img width="46" height="17" src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zsytk/topic/image/2022/08/05/1659844921705560.gif?(%20-%20\infty%203]" class="gsImgLatex mathType"/>,故选B.</p>"""
  213. print(get_maplef_items(s))