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

Function tokenize

experiments/baselines/nl_profile/runner.py:137–146  ·  view source on GitHub ↗
(text: Any)

Source from the content-addressed store, hash-verified

135
136
137def tokenize(text: Any) -> List[str]:
138 tokens: List[str] = []
139 for raw_token in TOKEN_RE.findall(str(text or "").casefold()):
140 token = raw_token.replace("_", "-")
141 if len(token) <= 1:
142 continue
143 tokens.append(token)
144 if "-" in token:
145 tokens.extend(part for part in token.split("-") if len(part) > 1)
146 return tokens
147
148
149def paper_text(row: Dict[str, Any]) -> str:

Callers 2

build_idf_from_textsFunction · 0.70
vectorize_textFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected