MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / _collect_matches

Method _collect_matches

claw-code/src/runtime.py:176–183  ·  view source on GitHub ↗
(self, tokens: set[str], modules: tuple[PortingModule, ...], kind: str)

Source from the content-addressed store, hash-verified

174 return denials
175
176 def _collect_matches(self, tokens: set[str], modules: tuple[PortingModule, ...], kind: str) -> list[RoutedMatch]:
177 matches: list[RoutedMatch] = []
178 for module in modules:
179 score = self._score(tokens, module)
180 if score > 0:
181 matches.append(RoutedMatch(kind=kind, name=module.name, source_hint=module.source_hint, score=score))
182 matches.sort(key=lambda item: (-item.score, item.name))
183 return matches
184
185 @staticmethod
186 def _score(tokens: set[str], module: PortingModule) -> int:

Callers 1

route_promptMethod · 0.95

Calls 3

_scoreMethod · 0.95
RoutedMatchClass · 0.85
appendMethod · 0.80

Tested by

no test coverage detected