Skip to main content

Module rank

Module rank 

Source
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}.