@@ -80,7 +80,7 @@ def _compute_costs(self, data):
80
80
and the remainder bits length is `unfilled_length`.
81
81
82
82
Args:
83
- data (str): The data to encode
83
+ data (str): The data to encode.
84
84
85
85
Returns:
86
86
void
@@ -93,9 +93,6 @@ def _compute_costs(self, data):
93
93
self .parents [0 ][mode ][0 ] = (0 , 0 , 0 )
94
94
95
95
for n in range (0 , len (data )):
96
- # print("----")
97
- # print(f"{n} -> {n+1}")
98
- # print(self.dp[n])
99
96
for mode in range (4 ):
100
97
for unfilled_length in range (3 ):
101
98
if self .dp [n ][mode ][unfilled_length ] == self .INF :
@@ -135,14 +132,11 @@ def _compute_costs(self, data):
135
132
self .dp [n + 1 ][new_mode ][new_length ] = self .dp [n ][mode ][unfilled_length ] + cost
136
133
self .parents [n + 1 ][new_mode ][new_length ] = (n , mode , unfilled_length )
137
134
138
- # print("=======")
139
- # print(self.dp[len(data)])
140
-
141
135
def _find_best (self , data ):
142
136
"""Find the index which has the minimum costs.
143
137
144
138
Args:
145
- data (str): The data to encode
139
+ data (str): The data to encode.
146
140
147
141
Returns:
148
142
tuple: The best index as tuple (n, mode, unfilled_length).
@@ -164,7 +158,7 @@ def _reconstruct_path(self, best_index):
164
158
best_index: The best index computed by self._find_best().
165
159
166
160
Returns:
167
- list: The path of minimum cost in the dynamic programming table
161
+ list: The path of minimum cost in the dynamic programming table.
168
162
169
163
"""
170
164
path = []
0 commit comments