html-keywords-matching 0.1.0

use ac trie to match keywords in html and replace them with a span tag
Documentation
use html_keywords_matching::{MatchResult, Trie};

fn main() {
    let mut trie = Trie::new();
    trie.build(vec![
        "openai".to_string(),
        "stack overflow".to_string(),
        "prompt engineering".to_string(),
    ]);

    // read from test.html
    let read = std::fs::read_to_string("examples/test.html").unwrap();

    let res: MatchResult = trie.search_replace(&read);

    println!("{:?}", res.match_words);

    // save res.text to test_modify.html
    std::fs::write("examples/test_modify.html", res.modified_html).unwrap();
}