Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # LZW sinifinin devami
- @staticmethod
- def decode(encoded, lzw_dict):
- res = ""
- reverse_lzw_dict = {}
- for k,v in lzw_dict.items():
- reverse_lzw_dict[v] = k
- for e in encoded:
- res+=reverse_lzw_dict[e]
- return res
- raw_str = "lzlzlzlw"
- res,ld = LZW.encode(raw_str)
- str1_a = LZW.decode(res,ld)
- print str1_a
- # Cikti: lzlzlzlw
Add Comment
Please, Sign In to add comment