class

Obelisk::PriorityLexerSelector

Inherits Reference < Object

Priority-based lexer selection system

Constructors

new(criteria : Obelisk::SelectionCriteria = SelectionCriteria.new)
Source

Instance methods

meets_threshold?(lexer : Lexer, text : String, threshold : Float32 = 0.5_f32, filename : String | Nil = nil, mime_type : String | Nil = nil) : Bool

Check if a lexer meets minimum threshold

Source
select(lexers : Array(Lexer), text : String, filename : String | Nil = nil, mime_type : String | Nil = nil) : SelectionResult | Nil

Select the best lexer for the given parameters

Source
select_ranked(lexers : Array(Lexer), text : String, filename : String | Nil = nil, mime_type : String | Nil = nil, limit : Int32 | Nil = nil) : Array(SelectionResult)

Select multiple lexers ranked by score

Source