MCPcopy Create free account
hub / github.com/Enfoirer/Text2GraphRAG / _split_chunk

Method _split_chunk

nano_graphrag/_splitter.py:74–80  ·  view source on GitHub ↗
(self, chunk: List[int])

Source from the content-addressed store, hash-verified

72 return merged_splits
73
74 def _split_chunk(self, chunk: List[int]) -> List[List[int]]:
75 result = []
76 for i in range(0, len(chunk), self._chunk_size - self._chunk_overlap):
77 new_chunk = chunk[i:i + self._chunk_size]
78 if len(new_chunk) > self._chunk_overlap: # 只有当 chunk 长度大于 overlap 时才添加
79 result.append(new_chunk)
80 return result
81
82 def _enforce_overlap(self, chunks: List[List[int]]) -> List[List[int]]:
83 result = []

Callers 1

_merge_splitsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected