auto_gitmoji/matcher/
mod.rs

1pub mod simple;
2
3use anyhow::Result;
4
5/// Confidence score for emoji matches
6pub type MatcherResult = Option<(String, String, f32)>; // (emoji_code, emoji_unicode, confidence)
7
8/// Core trait for gitmoji matching strategies
9pub trait GitmojiMatcher {
10    /// Match a commit message to an appropriate gitmoji
11    /// Returns (emoji_code, emoji_unicode, confidence_score) or None
12    fn match_emoji(&self, message: &str) -> Result<MatcherResult>;
13
14    /// Get the name of this matcher
15    fn name(&self) -> &'static str;
16}
17
18/// Factory for creating matcher instances
19pub struct MatcherFactory;
20
21impl MatcherFactory {
22    /// Create a simple keyword-based matcher
23    pub fn simple() -> Box<dyn GitmojiMatcher> {
24        Box::new(simple::SimpleMatcher::new())
25    }
26}