MCPcopy
hub / github.com/JaidedAI/EasyOCR / setLanguageList

Method setLanguageList

easyocr/easyocr.py:295–309  ·  view source on GitHub ↗
(self, lang_list, model)

Source from the content-addressed store, hash-verified

293 return char
294
295 def setLanguageList(self, lang_list, model):
296 self.lang_char = []
297 for lang in lang_list:
298 char_file = os.path.join(BASE_PATH, 'character', lang + "_char.txt")
299 with open(char_file, "r", encoding = "utf-8-sig") as input_file:
300 char_list = input_file.read().splitlines()
301 self.lang_char += char_list
302 if model.get('symbols'):
303 symbol = model['symbols']
304 elif model.get('character_list'):
305 symbol = model['character_list']
306 else:
307 symbol = '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ &#x27;
308 self.lang_char = set(self.lang_char).union(set(symbol))
309 self.lang_char = ''.join(self.lang_char)
310
311 def detect(self, img, min_size = 20, text_threshold = 0.7, low_text = 0.4,\
312 link_threshold = 0.4,canvas_size = 2560, mag_ratio = 1.,\

Callers 1

__init__Method · 0.95

Calls 1

getMethod · 0.80

Tested by

no test coverage detected