JBrowser Source Docs
You are reading the documentation for JBrowser 1.5.1. The newest release is 1.5.4. Go to the latest documentation

jbrowser.core.fuzzy

Generated from the source code of JBrowser 1.5.1.

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.