获取通常文本 :return text(text): 文本内容
(self, content: dict)
| 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 | """文本属性""" |
no test coverage detected