MCPcopy Create free account
hub / github.com/TIGER-AI-Lab/LongRAG / slice

Method slice

utils/tokenizers.py:28–32  ·  view source on GitHub ↗

Return a view of the list of tokens from [i, j).

(self, i=None, j=None)

Source from the content-addressed store, hash-verified

26 return len(self.data)
27
28 def slice(self, i=None, j=None):
29 """Return a view of the list of tokens from [i, j)."""
30 new_tokens = copy.copy(self)
31 new_tokens.data = self.data[i:j]
32 return new_tokens
33
34 def untokenize(self):
35 """Returns the original text (with whitespace reinserted)."""

Callers 1

entity_groupsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected