String Matching in Case of Periodicity in the Pattern
The string matching problem is an extensively studied computational problem having applications in many areas such as text editors, compilers, data compression, plagiarism detection, pattern recognition, etc. Dozens of algorithms have been designed to solve it. The finite automata method, Knuth-Morris-Pratt and Boyer-Moore algorithms are the ones of particular importance among them. The string matching in these algorithms is preceded by pattern preprocessing during which some structure supporting the string matching process is created, such as the finite automaton in the finite automata method and the table of prefix function in the Knuth-Morris-Pratt algorithm. The periodicity in pattern implies regularity in the supporting structure, which one can use to reduce the preprocessing time. In this paper, the problem of making the preprocessing phase more efficient in case of a periodic pattern is investigated for the finite automata method and the Knuth-Morris-Pratt algorithm. It is proved that the construction of supporting structure for the entire pattern in these cases can be reduced to its construction merely for the period of that pattern without affecting the processing of the text.
KeywordsString matching Finite automata method Knuth-Morris-Pratt algorithm Periodic pattern
This work was supported by the Ministry of Education and Science of the Republic of Armenia, project N 18T-1B341.
- 3.Baeza-Yates, R., Gonnet, G.: A new approach to text searching. In: ACM SIGIR Forum, vol. 23, no. SI, pp. 68–175. ACM, New York (1992)Google Scholar
- 5.Al-Khamaiseh, K., Al-Shagarin, S.: A survey of string matching algorithms. Int. J. Eng. Res. Appl. 4(7), 144–156 (2014)Google Scholar
- 9.Amir, A., Benson, G.: Detecting multiple periods and periodic patterns in event time sequences. In: Conference on Information and Knowledge Management, pp. 617–626. ACM, Singapore (2017)Google Scholar
- 11.Smyth, W.F.: Computing Patterns in Strings, 1st edn. Addison-Wesley, UK (2003)Google Scholar
- 13.Kostanyan A.: Fuzzy string matching with finite automata. In: Proceedings on 2017 IEEE Conference CSIT-2017, Yerevan, Armenia, pp. 25–29. IEEE Press, USA (2018)Google Scholar
- 14.Simon, I.: String matching algorithms and automata. In: Results and Trends in Theoretical Computer Science, pp. 386–395 (2005)Google Scholar