| status |
|---|
stable |
pub struct Pattern {
pub id: PatternId,
pub name: String,
pub domain: String,
pub language: String,
pub tags: Vec<String>,
pub template: Template,
pub confidence: f64,
pub usage: UsageStats,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}pub struct Template {
pub body: String,
pub variables: Vec<Variable>,
pub version: u32,
}pub struct MatchResult {
pub pattern_id: PatternId,
pub score: f64,
pub match_type: MatchType,
pub bindings: HashMap<String, String>,
}PatternStore::new(path)-- Create or open a pattern storestore.insert(pattern)-- Add a patternstore.get(id)-- Retrieve by IDstore.search(query)-- Search patternsstore.delete(id)-- Remove a patternstore.list()-- List all patterns
SignatureMatcher::match_against(signature, store)-- Match by signatureContextMatcher::match_against(context, store)-- Match by contextSemanticMatcher::match_against(text, store)-- Semantic matchFuzzyMatcher::match_against(text, store)-- Fuzzy match
Extractor::extract(source)-- Extract pattern from sourceVariableDetector::detect(source)-- Find template variablesTemplateGenerator::generate(source, variables)-- Generate templateConfidenceCalculator::calculate(template)-- Score confidence
Composer::compose(patterns)-- Compose multiple patternsGapFiller::fill(composed)-- Fill gaps between patternsAdapterGenerator::adapt(a, b)-- Generate type adapter