You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: spellcheck.rs
    path of file: ./repos/autocorrect/autocorrect/src/rule
    
    the code of the file until where you have to start completion: use std::collections::HashMap;

use crate::{config::Config, keyword::MatchedResult};

lazy_static! {
    static ref DISALLOW_CHAR_RE: regex::Regex =
        regexp!("{}", r#"([^\p{Han}\s？！：，。；、「」“”‘’【】《》])"#);
}

// Spell check by dict
pub fn format(text: &str) -> String {
    let config = Config::current();

    let word_map = &config.spellcheck.word_map;
    let matcher = &config.spellcheck.matcher;


    
    fn test_spellcheck_all() {
        crate::config::setup_test();

        let words = Config::current().spellcheck.words.clone();
        for l in words.iter() {
            let (left, right) = if l.contains('=') {
                let pars = l.split('=').collect::<Vec<_>>();
                (pars[0].trim(), pars[1].trim())
            } else {
                (l.as_str(), l.as_str())
            };

            assert_eq!(right, format(left));
            assert_eq!(right, format(&left.to_uppercase()));
            assert_eq!(right, format(&left.to_lowercase()));
        }
    }