JBrowser Source Docs

jbrowser.core.fuzzy

Generated from the source code of JBrowser 1.5.4.

jbrowser/core/fuzzy.py · 87 lines

Small, fast fuzzy matcher used by the Lazy Toolbar.

Scores subsequence matches, rewarding consecutive characters, word-boundary hits and prefix matches — similar in spirit to fzf / VS Code quick-open.

FuzzyMatch#

class FuzzyMatchsource

Attributes

Name Value
score float
positions tuple[int, ...]

Functions#

fuzzy_match#

fuzzy_match(pattern: str, text: str) -> FuzzyMatch | Nonesource

Return a score (higher is better) and matched indices, or None if no match.

best_match#

best_match(pattern: str, *fields: str) -> FuzzyMatch | Nonesource

Match against several fields; the first field (the title) is slightly preferred.