We introduce a data structure for counting pattern occurrences in texts compressed with any run-length context-free grammar. Our structure uses space proportional to the grammar size and counts the occurrences of a pattern of length $m$ in a text of length $n$ in time (O(m\log^{2+\epsilon} n)), for any constant (\epsilon > 0). This closes an open problem posed by Christiansen et al.~[ACM TALG 2020] and enhances our abilities for computation over compressed data; we give an example application.
翻译:本文提出了一种数据结构,用于在通过任意游程长度上下文无关文法压缩的文本中统计模式出现次数。该数据结构占用空间与文法规模成正比,并能在时间 (O(m\log^{2+\epsilon} n)) 内统计长度为 $m$ 的模式在长度为 $n$ 的文本中的出现次数,其中 (\epsilon > 0) 为任意常数。这解决了 Christiansen 等人~[ACM TALG 2020] 提出的一个公开问题,并增强了我们在压缩数据上进行计算的能力;文中给出了一个应用示例。