MCPcopy
hub / github.com/skywind3000/ECDICT / decode

Method decode

stardict.py:691–713  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

689 return text.replace('\r', '\\r')
690
691 def decode (self, text):
692 output = []
693 i = 0
694 if text is None:
695 return None
696 size = len(text)
697 while i < size:
698 c = text[i]
699 if c == '\\':
700 c = text[i + 1:i + 2]
701 if c == '\\':
702 output.append('\\')
703 elif c == 'n':
704 output.append('\n')
705 elif c == 'r':
706 output.append('\r')
707 else:
708 output.append('\\' + c)
709 i += 2
710 else:
711 output.append(c)
712 i += 1
713 return ''.join(output)
714
715 # 安全转行整数
716 def readint (self, text):

Callers 7

__obj_decodeMethod · 0.95
__readMethod · 0.80
loadMethod · 0.80
export_mdictMethod · 0.80
read_mdxMethod · 0.80
load_textMethod · 0.80
csv_loadMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected