mirror of
https://github.com/google/pebble.git
synced 2025-04-30 15:21:41 -04:00
spelling: occurrences
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
parent
76f2f9643f
commit
9cf1456fff
2 changed files with 4 additions and 4 deletions
|
@ -58,8 +58,8 @@ def encode(source):
|
||||||
frequency.update(source)
|
frequency.update(source)
|
||||||
# most_common() doesn't define what happens if there's a tie in frequency. Let's always pick
|
# most_common() doesn't define what happens if there's a tie in frequency. Let's always pick
|
||||||
# the lowest value of that frequency to make the encoding predictable.
|
# the lowest value of that frequency to make the encoding predictable.
|
||||||
occurences = frequency.most_common()
|
occurrences = frequency.most_common()
|
||||||
escape = min(x[0] for x in occurences if x[1] == occurences[-1][1])
|
escape = min(x[0] for x in occurrences if x[1] == occurrences[-1][1])
|
||||||
yield escape
|
yield escape
|
||||||
for b, g in groupby(source):
|
for b, g in groupby(source):
|
||||||
if b == b'\0':
|
if b == b'\0':
|
||||||
|
|
|
@ -58,8 +58,8 @@ def encode(source):
|
||||||
frequency.update(source)
|
frequency.update(source)
|
||||||
# most_common() doesn't define what happens if there's a tie in frequency. Let's always pick
|
# most_common() doesn't define what happens if there's a tie in frequency. Let's always pick
|
||||||
# the lowest value of that frequency to make the encoding predictable.
|
# the lowest value of that frequency to make the encoding predictable.
|
||||||
occurences = frequency.most_common()
|
occurrences = frequency.most_common()
|
||||||
escape = min(x[0] for x in occurences if x[1] == occurences[-1][1])
|
escape = min(x[0] for x in occurrences if x[1] == occurrences[-1][1])
|
||||||
yield escape
|
yield escape
|
||||||
for b, g in groupby(source):
|
for b, g in groupby(source):
|
||||||
if b == b'\0':
|
if b == b'\0':
|
||||||
|
|
Loading…
Add table
Reference in a new issue