|
12 | 12 | @dataclass
|
13 | 13 | class Token:
|
14 | 14 | """
|
15 |
| - Dataclass representing pair called token consisting of the dictionary index |
| 15 | + Dataclass representing pair called token consisting of the dictionary index |
16 | 16 | and a single character that follows the phrase in the dictionary.
|
17 | 17 | """
|
18 | 18 |
|
@@ -81,8 +81,8 @@ def decompress(self, tokens: list[Token]) -> str:
|
81 | 81 |
|
82 | 82 | Tests:
|
83 | 83 | >>> lz78_compressor = LZ78Compressor()
|
84 |
| - >>> lz78_compressor.decompress([Token(0, 'c'), Token(0, 'a'), Token(0, 'b'), |
85 |
| - ... Token(0, 'r'), Token(2, 'c'), Token(2, 'd'), Token(2, 'b'), Token(4, 'a'), |
| 84 | + >>> lz78_compressor.decompress([Token(0, 'c'), Token(0, 'a'), Token(0, 'b'), |
| 85 | + ... Token(0, 'r'), Token(2, 'c'), Token(2, 'd'), Token(2, 'b'), Token(4, 'a'), |
86 | 86 | ... Token(4, 'r'), Token(2, 'r'), Token(8, 'd')])
|
87 | 87 | 'cabracadabrarrarrad'
|
88 | 88 | >>> lz78_compressor.decompress([Token(0, 'a'), Token(0, 'b'), Token(1, 'b'),
|
|
0 commit comments