Parameterized String Matching by Text Sampling
Simone Faro, Thierry Lecroq, Francesco Pio Marino, Arianna Pavone, Antonio ScardaceString matching is a foundational problem in computer science with applications that span data mining, text retrieval, bioinformatics, and software engineering. Traditional string matching algorithms often face limitations with space and time efficiency, particularly in large-scale data applications. Sampled string matching is a recent approach designed to improve efficiency by addressing the high space requirements for index construction and reducing search time for online solutions. Parameterized pattern matching, a generalized form of string matching, introduces flexible matching criteria, initially developed to detect duplicate code and plagiarism in software maintenance. Its utility has since expanded to various domains, enabling adaptable matching across diverse applications. In this paper, we propose a novel algorithm for parameterized string matching that takes advantage of character distance sampling. This technique samples the distances between consecutive occurrences of a specified pivot character, facilitating an efficient online search within the sampled data for pattern occurrences before performing verification in the full text. Through extensive experimentation with diverse datasets, we demonstrate that our algorithm outperforms existing parameterized string matching methods in terms of speed. These results suggest that character distance sampling is a promising approach to enhance the efficiency and scalability of parameterized string matching algorithms, opening new avenues for application in large-scale and complex data environments.