Skip to content

Commit

Permalink
remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
Odyhibit committed Sep 11, 2024
1 parent faa70d4 commit 0219c51
Showing 1 changed file with 1 addition and 49 deletions.
50 changes: 1 addition & 49 deletions src/decode_five_strips_of_bacon.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def process_char(letter: str) -> str:
letter_bytes.extend(letter.encode())

if 0x1d400 <= ord(letter[0]) < 0x1D41A: # Bold Capital
output[0] = 1
output[3] = 1
if 0x1D41a <= ord(letter[0]) < 0x1D433: # Bold small
output[0] = 1
Expand Down Expand Up @@ -100,55 +101,6 @@ def process_char(letter: str) -> str:
return return_letter


def process_char_unicode(letter: str) -> str:
# pylint: disable=too-many-branches
"""decodes the attributes of one letter, and returns a hidden character
letter - string containing modifier characters, and the cover character
returns - string that is one decoded character
"""
if letter in (" ", ""):
return ""
if letter[0] in (" ", "\u2060"):
letter = letter[1:]

output = [0, 0, 0, 0, 0]
letter_bytes = bytearray()
letter_bytes.extend(letter.encode())
if len(letter) == 0:
return ""

if "\u0332" in letter: # underline
output[4] = 1
letter.replace("\u0332", "")
if "\u0336" in letter: # strikethrough
output[2] = 1
letter.replace("\u0336", "")
letter_bytes = bytearray()
letter_bytes.extend(letter.encode())
if 0x1d400 <= ord(letter[0]) < 0x1D41A: # Bold Capital
output[3] = 1
if 0x1D41a <= ord(letter[0]) < 0x1D433: # Bold small
output[0] = 1
if 0x1D434 <= ord(letter[0]) < 0x1D44E: # Italic Capital
output[1] = 1
output[3] = 1
if 0x1D44E <= ord(letter[0]) < 0x1D467 or (ord(letter[0]) == 0x210e): # Italic small
output[1] = 1

if 0x40 < ord(letter[0]) < 0x5b: # capital
output[3] = 1

binary_string = "".join(map(str, output))
if binary_string in reverse_bacon_dictionary:
return_letter = reverse_bacon_dictionary[binary_string]
else:
return f"{binary_string} is not a valid bacon encoding."
if len(letter) == 1 and ord(letter) == 0xfeff:
return_letter = " "
return return_letter


def process_word(cover_text: str) -> str:
"""Split cover text on zero-width space. use process_letter() to decode each
letter, and it's markdown characters.
Expand Down

0 comments on commit 0219c51

Please sign in to comment.