MCPcopy Create free account
hub / github.com/Topdu/OpenOCR / get_alpha

Function get_alpha

openrec/preprocess/dptr_label_encode.py:167–177  ·  view source on GitHub ↗
(alpha_path)

Source from the content-addressed store, hash-verified

165
166
167def get_alpha(alpha_path):
168 character_str = []
169 with open(alpha_path, 'rb') as fin:
170 lines = fin.readlines()
171 for line in lines:
172 line = line.decode('utf-8').strip('\n').strip('\r\n')
173 character_str.append(line)
174 dict_character = list(character_str)
175 if 'arabic' in alpha_path:
176 reverse = True
177 return dict_character

Callers 1

__init__Method · 0.85

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected