Class FuzzyScheme
java.lang.Object
org.aesh.readline.fuzzy.FuzzyScheme
Scoring constants for fuzzy matching.
Three preset schemes are provided matching fzf's --scheme option:
DEFAULT— General-purpose scoringPATH— Optimized for file paths (delimiter bonus for path separators)HISTORY— Optimized for command history (equalized boundary bonuses)
The scoring parameters are tuned so that the boundary bonus is cancelled when the gap between matching characters grows beyond ~8 characters (approximately the average word length).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortBonus for matching at a word boundary (after non-word/delimiter character).static final shortBonus for camelCase transitions (lower->UPPER) and number boundaries.static final shortMinimum bonus for consecutive matching characters.static final shortMultiplier for the first character's bonus.static final shortBonus for matching a non-word character.final shortBonus for word boundary after a delimiter (scheme-dependent).final shortBonus for word boundary after whitespace (scheme-dependent).static final FuzzySchemeDefault scheme — general-purpose fuzzy matching.static final FuzzySchemeHistory scheme — optimized for command history search.final intThe character class assumed before the first character.static final FuzzySchemePath scheme — optimized for file path matching.static final shortPenalty for extending a gap (each additional non-matching character).static final shortPenalty for starting a gap (non-matching characters between matches).static final shortScore awarded for each matching character. -
Method Summary
-
Field Details
-
SCORE_MATCH
public static final short SCORE_MATCHScore awarded for each matching character.- See Also:
-
SCORE_GAP_START
public static final short SCORE_GAP_STARTPenalty for starting a gap (non-matching characters between matches).- See Also:
-
SCORE_GAP_EXTENSION
public static final short SCORE_GAP_EXTENSIONPenalty for extending a gap (each additional non-matching character).- See Also:
-
BONUS_BOUNDARY
public static final short BONUS_BOUNDARYBonus for matching at a word boundary (after non-word/delimiter character). Set so that the bonus is cancelled when the gap exceeds ~8 characters.- See Also:
-
BONUS_NON_WORD
public static final short BONUS_NON_WORDBonus for matching a non-word character.- See Also:
-
BONUS_CAMEL_123
public static final short BONUS_CAMEL_123Bonus for camelCase transitions (lower->UPPER) and number boundaries. Slightly less than boundary bonus since camelCase doesn't have single-char gaps.- See Also:
-
BONUS_CONSECUTIVE
public static final short BONUS_CONSECUTIVEMinimum bonus for consecutive matching characters. Ensures consecutive chunks are ranked higher than gapped matches.- See Also:
-
BONUS_FIRST_CHAR_MULTIPLIER
public static final short BONUS_FIRST_CHAR_MULTIPLIERMultiplier for the first character's bonus. The first typed character is more significant — users typically start with the most important character.- See Also:
-
bonusBoundaryWhite
public final short bonusBoundaryWhiteBonus for word boundary after whitespace (scheme-dependent). -
bonusBoundaryDelimiter
public final short bonusBoundaryDelimiterBonus for word boundary after a delimiter (scheme-dependent). -
initialCharClass
public final int initialCharClassThe character class assumed before the first character. WHITE for default/history (beginning of input acts like a word boundary), DELIMITER for path scheme (beginning acts like after a path separator). -
DEFAULT
Default scheme — general-purpose fuzzy matching. Whitespace boundaries get a small extra bonus over delimiter boundaries. -
PATH
Path scheme — optimized for file path matching. Whitespace and delimiter boundaries are equalized. Path separators get a slight edge. Beginning of input is treated as after a delimiter. -
HISTORY
History scheme — optimized for command history search. All boundary types get equal bonus since whitespace and delimiters are equally important in command strings.
-