Skip to main content

Table 3 An example of compression

From: RNACompress: Grammar-based compression and informational complexity measurement of RNA secondary structure

Step

Stack

Input buffer

Production Rules of G2

Map to G1

Huffman code

1

# S

(((...))).#

S:LS

S:LS

0

2

# S L

(((...))).#

L:(S)

S:gSu

01111

3

# S) S (

(((...))).#

   

4

# S) S

((...))).#

S:LS

S:LS

0

5

# S) S L

((...))).#

L:(S)

S:uSa

1110

6

# S) S) S (

((...))).#

   

7

# S) S) S

(...))).#

S:LS

S:LS

0

8

# S) S) S L

(...))).#

L:(S)

S:gSc

101

9

# S) S) S) S (

(...))).#

   

10

# S) S) S) S

...))).#

S:LS

S:LS

0

11

# S) S) S) S L

...))).#

L: •

L:a

00

12

# S) S) S) S .

...))).#

   

13

# S) S) S) S

..))).#

S:LS

S:LS

0

14

# S) S) S) S L

..))).#

L: •

L:g

010

15

# S) S) S) S .

..))).#

   

16

# S) S) S) S

.))).#

S:LS

S:LS

0

17

# S) S) S) S L

.))).#

L: •

L:c

1111

18

# S) S) S) S .

.))).#

   

19

# S) S) S) S

))).#

S:e

S:e

1

20

# S) S) S)

))).#

   

21

# S) S) S

)).#

S:e

S:e

1

22

# S) S)

)).#

   

23

# S) S

).#

S:e

S:e

1

24

# S)

).#

   

25

# S

.#

S:LS

S:LS

0

26

# S L

.#

L: •

L:g

010

27

# S .

.#

   

28

# S

#

S:e

S:e

1

29

#

#

  Â