html-keywords-matching 0.1.0

use ac trie to match keywords in html and replace them with a span tag
Documentation
mod trie;

use std::{cell::RefCell, collections::HashMap, rc::Rc};

#[derive(Debug)]
pub struct MatchResult {
    pub match_words: HashMap<String, usize>,
    pub modified_html: String,
}

type TrieNodeRef = Rc<RefCell<TrieNode>>;

struct TrieNode {
    is_end_words: bool,
    children: HashMap<char, TrieNodeRef>,
    fail: Option<TrieNodeRef>,
    depth: usize,
}

pub struct Trie {
    root: TrieNodeRef,
}