The dictionary matching is a task to find all occurrences of patterns in a set (called a dictionary) on a text . The Aho-Corasick-automaton (AC-automaton) is a data structure which enables us to solve the dictionary matching problem in preprocessing time and matching time, where is the total length of the patterns in , is the length of the text, is the alphabet size, and is the total number of occurrences of all the patterns in the text. The dynamic dictionary matching is a variant where patterns may dynamically be inserted into and deleted from . This problem is called semi-dynamic dictionary matching if only insertions are allowed. In this paper, we propose two efficient algorithms. For a pattern of length , our first algorithm supports insertions in time and pattern matching in time for the semi-dynamic setting and supports both insertions and deletions in time and pattern matching in time for the dynamic setting by some modifications. This algorithm is based on the directed acyclic word graph. Our second algorithm, which is based on the AC-automaton, supports insertions in time for the semi-dynamic setting and supports both insertions and deletions in $O(\sigma m+u_f+u_o)u_fu_o$ respectively denote the numbers of states in which the failure function and the output function need to be updated. This algorithm performs pattern matching in time for both settings. Our algorithm achieves optimal update time for AC-automaton based methods over constant-size alphabets, since any algorithm which explicitly maintains the AC-automaton requires update time.

生成讲解博客的中文版本

生成AI智能校验的中文版本