MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / tokenizeSegment

Function tokenizeSegment

apps/cli/src/tooling.ts:339–346  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

337};
338
339const tokenizeSegment = (input: string): ReadonlyArray<string> =>
340 input
341 .replace(/([a-z0-9])([A-Z])/g, "$1 $2")
342 .replace(/[._-]+/g, " ")
343 .trim()
344 .toLowerCase()
345 .split(/\s+/)
346 .filter((token) => token.length > 0);
347
348const tokenVariants = (input: string): ReadonlyArray<string> => {
349 const token = input.toLowerCase();

Callers 1

segmentMatchesTokenFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected