(self, content: str)
| 67 | self.filename = "./__cache__/案例.txt" |
| 68 | |
| 69 | def __slice_content(self, content: str) -> List[str]: |
| 70 | ret = [] |
| 71 | |
| 72 | for line in content.split("。"): |
| 73 | if len(ret) == 0 or len(ret[-1]) + len(line) > 200: |
| 74 | if len(ret) > 0: |
| 75 | ret[-1] += "。" |
| 76 | ret.append("") |
| 77 | |
| 78 | if ret[-1]: |
| 79 | ret[-1] += "。" |
| 80 | ret[-1] += line |
| 81 | |
| 82 | return ret |
| 83 | |
| 84 | def parse(self) -> List[Case]: |
| 85 | with open(self.filename, "r") as f: |