class NoirAIContext::PatternDefinition

Overview

Declarative detection rule shared by every catalog in Patterns.

A rule pairs a #kind label (the AIContextEntry kind it raises) with two regex sets: #name_patterns match against a callee / parameter name, #source_patterns match against a source snippet. When either set hits, the matcher emits an entry of #kind at #confidence.

Defined in:

ai_context/pattern_definition.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(kind : String, description : String, confidence : Int32, *, name_patterns : Array(Regex) = [] of Regex, source_patterns : Array(Regex) = [] of Regex) #

[View source]

Instance Method Detail

def confidence : Int32 #

[View source]
def description : String #

[View source]
def kind : String #

[View source]
def name_patterns : Array(Regex) #

[View source]
def source_patterns : Array(Regex) #

[View source]