MCPcopy
hub / github.com/MinishLab/semble / _keywords

Function _keywords

benchmarks/token_efficiency.py:126–136  ·  view source on GitHub ↗

Extract meaningful search keywords from a natural-language query.

(query: str)

Source from the content-addressed store, hash-verified

124
125
126def _keywords(query: str) -> list[str]:
127 """Extract meaningful search keywords from a natural-language query."""
128 words = re.findall(r"[a-zA-Z][a-zA-Z0-9]*", query)
129 seen: set[str] = set()
130 result: list[str] = []
131 for w in words:
132 lw = w.lower()
133 if len(lw) >= _KW_MIN_LEN and lw not in _STOPWORDS and lw not in seen:
134 seen.add(lw)
135 result.append(w)
136 return result
137
138
139def _grep_keywords_file_units(query: str, repo_dir: Path) -> list[Chunk]:

Callers 1

Calls 1

addMethod · 0.80

Tested by

no test coverage detected