{'fraction_non_alphanumeric': 0.014669926650366748, 'fraction_numerical': 0.0, 'mean_word_length': 5.713114754098361, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A fast template matching algorithm with adaptive skipping using inner-subtemplates' distances

This paper proposes a new fast template matching algorithm that skips comparison between a template and search windows neighboring an already compared dissimilar sub-window. Comparison skipping is executed when a lower bound of distance between the template and a window exceeds a threshold. The lower bound of distance between the template and the window is determined by the triangular inequality in distances: the distance between a subtemplate and a subwindow and that between inter-subtemplates. Experimental results demonstrate that the proposed method is up to five times faster than the conventional fast exhaustive search method (sequential similarity detection algorithm), strictly guaranteeing the same accuracy.