MCPcopy
hub / github.com/LawRefBook/Laws / __slice_content

Method __slice_content

scripts/convert.py:69–82  ·  view source on GitHub ↗
(self, content: str)

Source from the content-addressed store, hash-verified

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:

Callers 1

parseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected