MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / tokenize

Function tokenize

experiments/baselines/discourse_aware/runner.py:215–224  ·  view source on GitHub ↗
(text: Any)

Source from the content-addressed store, hash-verified

213
214
215def tokenize(text: Any) -> List[str]:
216 tokens: List[str] = []
217 for raw_token in TOKEN_RE.findall(str(text or "").casefold()):
218 token = raw_token.replace("_", "-")
219 if len(token) <= 1:
220 continue
221 tokens.append(token)
222 if "-" in token:
223 tokens.extend(part for part in token.split("-") if len(part) > 1)
224 return tokens
225
226
227def split_sentences(text: Any) -> List[str]:

Callers 2

build_idf_from_textsFunction · 0.70
vectorize_textFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected