struct

Nucleoc::Config

Inherits Struct < Value < Object

Configuration data that controls how a matcher behaves

Constants

DEFAULT = new(delimiter_chars: "/,:;|", bonus_boundary_white: BONUS_BOUNDARY + 2_u16, bonus_boundary_delimiter: BONUS_BOUNDARY + 1_u16, initial_char_class: CharClass::Whitespace, normalize: true, ignore_case: true, prefer_prefix: false)

Default configuration for nucleoc

Constructors

new(delimiter_chars : String = "/,:;|", bonus_boundary_white : UInt16 = BONUS_BOUNDARY + 2_u16, bonus_boundary_delimiter : UInt16 = BONUS_BOUNDARY + 1_u16, initial_char_class : CharClass = CharClass::Whitespace, normalize : Bool = true, ignore_case : Bool = true, prefer_prefix : Bool = false)
Source

Instance methods

bonus_boundary_delimiter

Extra bonus for word boundary after slash, colon, semi-colon, and comma

Source
bonus_boundary_delimiter=(bonus_boundary_delimiter : UInt16)

Extra bonus for word boundary after slash, colon, semi-colon, and comma

Source
bonus_boundary_white

Extra bonus for word boundary after whitespace character or beginning of the string

Source
bonus_boundary_white=(bonus_boundary_white : UInt16)

Extra bonus for word boundary after whitespace character or beginning of the string

Source
bonus_for(prev_class : CharClass, char_class : CharClass) : UInt16

Calculate bonus for a character based on its position and previous character class This matches the Rust Config.bonus_for method exactly

Source
delimiter_chars

Characters that act as delimiters and provide bonus for matching the following char

Source
delimiter_chars=(delimiter_chars : String)

Characters that act as delimiters and provide bonus for matching the following char

Source
ignore_case=(ignore_case : Bool)

Whether to ignore casing

Source
ignore_case?

Whether to ignore casing

Source
initial_char_class

Initial character class (used for boundary detection)

Source
initial_char_class=(initial_char_class : CharClass)

Initial character class (used for boundary detection)

Source
match_paths

Configures the matcher with bonuses appropriate for matching file paths.

Source
normalize=(normalize : Bool)

Whether to normalize latin script characters to ASCII (enabled by default)

Source
normalize?

Whether to normalize latin script characters to ASCII (enabled by default)

Source
prefer_prefix=(prefer_prefix : Bool)

Whether to provide a bonus to matches by their distance from the start of the haystack. The bonus is fairly small compared to the normal gap penalty to avoid messing with the normal score heuristic. This setting is not turned on by default and only recommended for autocompletion usecases where the expectation is that the user is typing the entire match. For a full fzf-like fuzzy matcher/picker word segmentation and explicit prefix literals should be used instead.

Source
prefer_prefix?

Whether to provide a bonus to matches by their distance from the start of the haystack. The bonus is fairly small compared to the normal gap penalty to avoid messing with the normal score heuristic. This setting is not turned on by default and only recommended for autocompletion usecases where the expectation is that the user is typing the entire match. For a full fzf-like fuzzy matcher/picker word segmentation and explicit prefix literals should be used instead.

Source