(file_path)
| 39 | |
| 40 | # 读取文件并查找中文简介 |
| 41 | def read_file_to_memory(file_path): |
| 42 | search_results = search_in_file(file_path, "zh-CN") |
| 43 | lines = [] |
| 44 | chinese_texts = [] |
| 45 | for name_match in search_results.name_matches: |
| 46 | lines.append(name_match) |
| 47 | chinese_texts.append((len(lines) - 1, name_match)) |
| 48 | for description_match in search_results.description_matches: |
| 49 | lines.append(description_match) |
| 50 | chinese_texts.append((len(lines) - 1, description_match)) |
| 51 | return chinese_texts |
| 52 | |
| 53 | |
| 54 | # 用于保存翻译结果的线程函数 |
no test coverage detected