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

Method __init__

utils/tokenizers.py:148–161  ·  view source on GitHub ↗

Args: annotators: None or empty set (only tokenizes).

(self, **kwargs)

Source from the content-addressed store, hash-verified

146 NON_WS = r"[^\p{Z}\p{C}]"
147
148 def __init__(self, **kwargs):
149 """
150 Args:
151 annotators: None or empty set (only tokenizes).
152 """
153 self._regexp = regex.compile(
154 "(%s)|(%s)" % (self.ALPHA_NUM, self.NON_WS),
155 flags=regex.IGNORECASE + regex.UNICODE + regex.MULTILINE,
156 )
157 if len(kwargs.get("annotators", {})) > 0:
158 logger.warning(
159 "%s only tokenizes! Skipping annotators: %s" % (type(self).__name__, kwargs.get("annotators"))
160 )
161 self.annotators = set()
162
163 def tokenize(self, text):
164 data = []

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected