return ''.join(self._morse_char_map.get(piece, piece[0]) for piece in (code
    [i:i + 5] for i in range(0, len(code), 5)))
How can I analyze or improve my niece's simple compression algorithm that is based on Morse code?