MCPcopy
hub / github.com/DeppWang/youdaonote-pull / _get_common_text

Method _get_common_text

core/covert.py:172–193  ·  view source on GitHub ↗

获取通常文本 :return text(text): 文本内容

(self, content: dict)

Source from the content-addressed store, hash-verified

170 """
171
172 def _get_common_text(self, content: dict) -> Tuple[list, str]:
173 """获取通常文本
174 :return
175 text(text): 文本内容
176 """
177 all_text = ""
178 # 5 内容
179 five_contents = content.get("5")
180 # 判断是否是普通文本
181 if five_contents:
182 seven_contents = five_contents[0].get("7")
183 if not seven_contents:
184 return all_text
185 for seven_content in seven_contents:
186 # 8 文本
187 text = seven_content.get("8")
188 # 9 文本属性
189 text_attrs = seven_content.get("9")
190 if text and text_attrs:
191 text = self._convert_text_attribute(text, text_attrs)
192 all_text += text
193 return all_text
194
195 def _convert_text_attribute(self, text: str, text_attrs: list):
196 """文本属性"""

Callers 6

convert_text_funcMethod · 0.95
convert_h_funcMethod · 0.95
convert_cd_funcMethod · 0.95
convert_la_funcMethod · 0.95
convert_q_funcMethod · 0.95
convert_l_funcMethod · 0.95

Calls 1

Tested by

no test coverage detected