Fast and flexible word searching on compressed text

被引:112
作者
de Moura, ES
Navarro, G
Ziviani, N
BaezaYates, R
机构
[1] Univ Fed Minas Gerais, Dept Comp Sci, BR-31270010 Belo Horizonte, MG, Brazil
[2] Univ Chile, Dept Comp Sci, Santiago, Chile
关键词
compressed pattern matching; natural language text compression; word searching; word-based Huffman coding;
D O I
10.1145/348751.348754
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
We present a fast compression and decompression technique for natural language texts. The novelties are that (1) decompression of arbitrary portions of the text can be done very efficiently, (2) exact search for words and phrases can be done on the compressed text directly, using any known sequential pattern-matching algorithm, and (3) word-based approximate and extended search can also be done efficiently without any decoding. The compression scheme uses a semistatic word-based model and a Huffman code where the coding alphabet is byte-oriented rather than bit-oriented. We compress typical English texts to about 30% of their original size, against 40% and 35% for Compress and Gzip, respectively. Compression time is close to that of Compress and approximately half the time of Gzip, and decompression time is lower than that of Gzip and one third of that of Compress. We present three algorithms to search the compressed text;. They allow a large number of variations over the basic word and phrase search capability, such as sets of characters, arbitrary regular expressions, and approximate matching. Separators and stopwords can be discarded at search time without significantly increasing the cost. When searching for simple words, the experiments show that running our algorithms on a compressed text is twice as fast as running the best existing software on the uncompressed version of the same text. When searching complex or approximate patterns, our algorithms are up, to 8 times faster than the search on uncompressed text. We also discuss the impact of our technique in inverted files pointing to logical blocks and argue for the possibility of keeping the text compressed all the time, decompressing only for displaying purposes.
引用
收藏
页码:113 / 139
页数:27
相关论文
共 43 条
  • [1] EFFICIENT STRING MATCHING - AID TO BIBLIOGRAPHIC SEARCH
    AHO, AV
    CORASICK, MJ
    [J]. COMMUNICATIONS OF THE ACM, 1975, 18 (06) : 333 - 340
  • [2] Let sleeping files lie: Pattern matching in Z-compressed files
    Amir, A
    Benson, G
    Farach, M
    [J]. JOURNAL OF COMPUTER AND SYSTEM SCIENCES, 1996, 52 (02) : 299 - 307
  • [3] Amir A., 1992, P 2 IEEE DAT COMPR C, P279
  • [4] [Anonymous], 1949, Human behaviour and the principle of least-effort
  • [5] ARAUJO MD, 1997, P 4 S AM WORKSH STRI, V8, P2
  • [6] Faster approximate string matching
    BaezaYates, R
    Navarro, G
    [J]. ALGORITHMICA, 1999, 23 (02) : 127 - 158
  • [7] A NEW APPROACH TO TEXT SEARCHING
    BAEZAYATES, R
    GONNET, GH
    [J]. COMMUNICATIONS OF THE ACM, 1992, 35 (10) : 74 - 82
  • [8] BAEZAYATES R, 1997, P 6 INT C INF KNOWL
  • [9] BAEZAYATES RA, 1999, MODERN INFORMATION R
  • [10] Bell T. C., 1999, Managing Gigabytes, V2nd ed