English

Computing q-gram Non-overlapping Frequencies on SLP Compressed Texts

Data Structures and Algorithms 2011-07-18 v1

Abstract

Length-qq substrings, or qq-grams, can represent important characteristics of text data, and determining the frequencies of all qq-grams contained in the data is an important problem with many applications in the field of data mining and machine learning. In this paper, we consider the problem of calculating the {\em non-overlapping frequencies} of all qq-grams in a text given in compressed form, namely, as a straight line program (SLP). We show that the problem can be solved in O(q2n)O(q^2n) time and O(qn)O(qn) space where nn is the size of the SLP. This generalizes and greatly improves previous work (Inenaga & Bannai, 2009) which solved the problem only for q=2q=2 in O(n4logn)O(n^4\log n) time and O(n3)O(n^3) space.

Keywords

Cite

@article{arxiv.1107.3022,
  title  = {Computing q-gram Non-overlapping Frequencies on SLP Compressed Texts},
  author = {Keisuke Goto and Hideo Bannai and Shunsuke Inenaga and Masayuki Takeda},
  journal= {arXiv preprint arXiv:1107.3022},
  year   = {2011}
}
R2 v1 2026-06-21T18:37:22.754Z