Expand description
Code-aware ranking signals for hybrid search: identifier splitting, lexical scoring, query classification, and path penalties. Ideas borrowed from semble (re-implemented, not copied); comindly adds a dependency-graph centrality signal on top (applied by the caller).
Functions§
- is_
symbol_ query - Symbol-like query? (identifier path, snake/camel case, punctuation, or a single word) Such queries weight lexical matching higher (α smaller).
- lexical_
score - Lexical overlap in
[0,1]: fraction of query keywords matching the symbol’s identifier sub-tokens (prefix match allowed for stems ≥4 chars). - path_
penalty - Path-based noise penalty multiplier (semble’s structured penalties).
- query_
keywords - Extract meaningful lowercased query keywords (>2 chars, non-stopword).
- resolve_
alpha - Weight on the semantic signal (the rest goes to lexical). Symbol queries favor lexical.
- split_
identifier - Split an identifier into lowercased sub-tokens, camelCase + snake_case aware, keeping the
compound form.
getHTTPResponse-> {gethttpresponse, get, http, response};my_func-> {my_func, my, func}.